Esempio n. 1
0
        private void DestroyHelpers()
        {
            if (m_disableInputFieldKeyboardInput != null)
            {
                m_disableInputFieldKeyboardInput.Destroy();
                m_disableInputFieldKeyboardInput = null;
            }

            if (m_isFocusedListener != null)
            {
                m_isFocusedListener.IsFocusedChanged -= OnIsFocusedChanged;
                Destroy(m_isFocusedListener);
                m_isFocusedListener = null;
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Must be executed befroe OnSelect of InputField
        /// </summary>
        /// <param name="eventData"></param>
        public void OnSelect(BaseEventData eventData)
        {
            if (gameObject.GetComponent <DisableInputFieldKeyboard>() == null)
            {
                m_disableInputFieldKeyboardInput             = gameObject.AddComponent <DisableInputFieldKeyboard>();
                m_disableInputFieldKeyboardInput.EventSystem = EventSystem;
            }

            //if (m_openOnSelect)
            //{
            //    IsEditing = true;
            //}
            //else
            {
                ClearTextComponent();
            }

            if (m_virtualKeyboard != null)
            {
                m_virtualKeyboard.KeyPressed -= OnKeyPressed;
                m_virtualKeyboard.KeyPressed += OnKeyPressed;
            }


            m_isInputFieldReadOnly = m_inputField.readOnly;
            if (VirtualKeyboardEnabled)
            {
                m_inputField.readOnly = true;
            }

            if (gameObject.GetComponent <InputFieldIsFocusedListener>() == null)
            {
                m_isFocusedListener = gameObject.AddComponent <InputFieldIsFocusedListener>();
                m_isFocusedListener.IsFocusedChanged += OnIsFocusedChanged;
            }

            m_inputRT = m_inputField.GetComponent <RectTransform>();

            if (m_virtualKeyboard != null)
            {
                m_kbRT = m_virtualKeyboard.GetComponent <RectTransform>();
            }
        }