Пример #1
0
    /// <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();
    }
Пример #2
0
    /// <summary>
    /// Execute the OnChange callback.
    /// </summary>

    protected void ExecuteOnChange()
    {
        if (current == null && EventDelegate.IsValid(onChange))
        {
            current = this;
            EventDelegate.Execute(onChange);
            current = null;
        }
    }
Пример #3
0
    /// <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;
        }
    }
Пример #4
0
    /// <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);
        }
    }
Пример #5
0
    /// <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();
    }
Пример #6
0
    /// <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;
    }
Пример #7
0
    /// <summary>
    /// Execute the OnChange callback.
    /// </summary>

    protected void ExecuteOnChange()
    {
        if (current == null && EventDelegate.IsValid(onChange))
        {
            current = this;
            EventDelegate.Execute(onChange);
            current = null;
        }
    }
Пример #8
0
    /// <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);
        }
    }