/// <summary> /// Notification of the input field losing selection. /// </summary> protected void OnDeselectEvent() { if (mDoInit) { Init(); } if (label != null && NGUITools.GetActive(this)) { mValue = value; #if MOBILE if (mKeyboard != null) { mWaitForKeyboard = false; mKeyboard.active = false; mKeyboard = null; } #endif if (string.IsNullOrEmpty(mValue)) { label.text = mDefaultText; label.color = mDefaultColor; } else { label.text = mValue; } Input.imeCompositionMode = IMECompositionMode.Auto; RestoreLabelPivot(); } selection = null; UpdateLabel(); }
/// <summary> /// Execute the OnChange callback. /// </summary> protected void ExecuteOnChange() { if (current == null && EventDelegate.IsValid(onChange)) { current = this; EventDelegate.Execute(onChange); current = null; } }
/// <summary> /// Notification of the input field gaining selection. /// </summary> protected void OnSelectEvent() { selection = this; if (mDoInit) { Init(); } // Unity has issues bringing up the keyboard properly if it's in "hideInput" mode and you happen // to select one input in the same Update as de-selecting another. if (label != null && NGUITools.GetActive(this)) { mSelectMe = Time.frameCount; } }
/// <summary> /// Submit the input field's text. /// </summary> public void Submit() { if (NGUITools.GetActive(this)) { mValue = value; if (current == null) { current = this; EventDelegate.Execute(onSubmit); current = null; } SaveToPlayerPrefs(mValue); } }
/// <summary> /// Notification of the input field losing selection. /// </summary> protected void OnDeselectEvent() { if (mDoInit) Init(); if (label != null && NGUITools.GetActive(this)) { mValue = value; #if MOBILE if (mKeyboard != null) { mWaitForKeyboard = false; mKeyboard.active = false; mKeyboard = null; } #endif if (string.IsNullOrEmpty(mValue)) { label.text = mDefaultText; label.color = mDefaultColor; } else label.text = mValue; Input.imeCompositionMode = IMECompositionMode.Auto; RestoreLabelPivot(); } selection = null; UpdateLabel(); }
/// <summary> /// Notification of the input field gaining selection. /// </summary> protected void OnSelectEvent() { selection = this; if (mDoInit) Init(); // Unity has issues bringing up the keyboard properly if it's in "hideInput" mode and you happen // to select one input in the same Update as de-selecting another. if (label != null && NGUITools.GetActive(this)) mSelectMe = Time.frameCount; }