/// <summary> /// Update the text button object properties and callback methods based on the text input button state. /// </summary> /// <param name="textInput"></param> public void UpdateKeyboardState(TextInputObject textInput) { ResetKeyboardProperties(); //If the button is on an active state if (textInput.Button.CurrentDimension.Equals(1)) { keyboard.OnHideKeyboard.AddListener(() => ResetKeyboardProperties()); CurrentlyActiveTextbox = textInput; keyboard.ShowKeyboard(); } }
/// <summary> /// Reset keyboard /// </summary> public void ResetKeyboardProperties() { //Reset keyboard keyboard.ClearKeyboardText(); keyboard.HideKeyboard(); //Remove all events attached to the keyboard keyboard.OnHideKeyboard.RemoveAllListeners(); //Reset currently active button if (!(CurrentlyActiveTextbox == null)) { CurrentlyActiveTextbox.Button.CurrentDimension = 0; } CurrentlyActiveTextbox = null; }