示例#1
0
        public static CanvasKeyboard Open(Canvas canvas, GameObject inputObject = null, CanvasKeyboardType keyboardType = CanvasKeyboardType.ASCIICapable)
        {
            // Don't open the keyboard if it is already open for the current input object
            CanvasKeyboard keyboard = GameObject.FindObjectOfType <CanvasKeyboard>();

            if (keyboard == null || (keyboard != null && keyboard.inputObject != inputObject))
            {
                Close();
                keyboard = Instantiate <CanvasKeyboard>(Resources.Load <CanvasKeyboard>("CanvasKeyboard"));
                keyboard.transform.SetParent(canvas.transform, false);
                keyboard.inputObject = inputObject;
            }
            return(keyboard);
        }
示例#2
0
 public void CloseKeyboard()
 {
     isOpening = false;
     CanvasKeyboard.Close();
 }
示例#3
0
 public void OpenKeyboard()
 {
     isOpening = true;
     CanvasKeyboard.Open(CanvasKeyboardObject, inputObject != null ? inputObject : gameObject);
 }
示例#4
0
 // Use this for initialization
 void Start()
 {
     try {
         keyboard = GameObject.FindObjectsOfType<CanvasKeyboard>()[0];
     }
     catch {
         keyboard = null;
         Debug.Log("No keyboard"); //should not happen
     }
     duration = 0;
     onKey = false;
 }
		public void CloseKeyboard() 
		{
            #if !UNITY_EDITOR
			CanvasKeyboard.Close ();
            #endif
        }
		public void OpenKeyboard() 
		{
            #if !UNITY_EDITOR
            CanvasKeyboard.Open(CanvasKeyboardObject, inputObject != null ? inputObject : gameObject);
            #endif
		}
示例#7
0
 public void CloseKeyboard()
 {
     CanvasKeyboard.Close();
 }