sbot1101

unity deactivate inputfield

Feb 8th, 2015
1,422
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.40 KB | None | 0 0
  1. using UnityEngine;
  2. using UnityEngine.UI;
  3. using System.Collections;
  4.  
  5. public class GamepadInputFieldHelper : MonoBehaviour {
  6.  
  7.     InputField _inputField;
  8.  
  9.  
  10.     // Use this for initialization
  11.     void Start () {
  12.         _inputField = GetComponent<InputField>();
  13.     }
  14.    
  15.     // Update is called once per frame
  16.     void Update () {
  17.         if(Input.GetButtonUp("Submit"))
  18.         {
  19.             _inputField.DeactivateInputField();
  20.         }
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment