Exemplo n.º 1
0
        protected override void OnEnable()
        {
            base.OnEnable();
            CheckAsteriskChar();

            MobileInputBehaviour v_nativeBox = GetComponent <MobileInputBehaviour>();

            if (MobileInputBehaviour.IsSupported())
            {
                if (v_nativeBox == null && Application.isPlaying)
                {
                    v_nativeBox = gameObject.AddComponent <MobileInputBehaviour>();
                }
            }
            //Not Supported Platform
            else
            {
                if (Application.isPlaying)
                {
                    if (v_nativeBox != null)
                    {
                        Debug.LogWarning("[TMP_NativeInputField] Not Supported Platform (sender " + name + ")");
                        GameObject.Destroy(v_nativeBox);
                    }
                }
            }

            //Activate native edit box
            if (v_nativeBox != null)
            {
                v_nativeBox.hideFlags = HideFlags.None;
                if (enabled && !v_nativeBox.enabled)
                {
                    v_nativeBox.enabled = true;
                }
            }
            RegisterEvents();

            //Update Simbling Index
            if (CachedInputRenderer != null && m_TextComponent != null)
            {
                CachedInputRenderer.transform.SetSiblingIndex(m_TextComponent.transform.GetSiblingIndex());
                AssignPositioningIfNeeded();
            }
        }
Exemplo n.º 2
0
        protected override void OnEnable()
        {
            base.OnEnable();
            CheckAsteriskChar();

            MobileInputBehaviour v_nativeBox = GetComponent <MobileInputBehaviour>();

            if (MobileInputBehaviour.IsSupported())
            {
                if (v_nativeBox == null && Application.isPlaying)
                {
                    v_nativeBox = gameObject.AddComponent <MobileInputBehaviour>();
                }
            }
            //Not Supported Platform
            else
            {
                if (Application.isPlaying)
                {
                    if (v_nativeBox != null)
                    {
                        Debug.LogWarning("[NativeInputField] Not Supported Platform (sender " + name + ")");
                        GameObject.Destroy(v_nativeBox);
                    }
                }
            }

            //Activate native edit box
            if (v_nativeBox != null)
            {
                v_nativeBox.hideFlags = HideFlags.None;
                if (enabled && !v_nativeBox.enabled)
                {
                    v_nativeBox.enabled = true;
                }
            }
            RegisterEvents();
        }
Exemplo n.º 3
0
        protected bool IsNativeKeyboardSupported()
        {
            var v_isSupported = TouchScreenKeyboard.isSupported && shouldHideMobileInput && MobileInputBehaviour.IsSupported();

            return(v_isSupported);
        }
Exemplo n.º 4
0
        protected bool IsUnityKeyboardSupported()
        {
            var v_isSupported = TouchScreenKeyboard.isSupported && (!shouldHideMobileInput || !MobileInputBehaviour.IsSupported());

            return(v_isSupported);
        }