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); }
public void CloseKeyboard() { isOpening = false; CanvasKeyboard.Close(); }
public void OpenKeyboard() { isOpening = true; CanvasKeyboard.Open(CanvasKeyboardObject, inputObject != null ? inputObject : gameObject); }
// 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 }
public void CloseKeyboard() { CanvasKeyboard.Close(); }