Beispiel #1
0
        void DeactivateKeyboard()
        {
#if UNITY_IPHONE && !UNITY_EDITOR
            _handleTouches = false;
            if (_keyboard != null)
            {
                string _keyboardText = _keyboard.text;
                if (_keyboardText.Length > 0)
                {
                    _message         = _keyboardText;
                    inputMobile.text = _keyboardText;
                    ChangeInputFieldColorAlpha(true);
                }
                else
                {
                    _message         = string.Empty;
                    inputMobile.text = _placeholderText;
                    ChangeInputFieldColorAlpha(false);
                }
                _keyboard.active = false;
                _keyboard.text   = string.Empty;
                _keyboard        = null;
            }

            FIZZTouchScreenKeyboard.SetCustomMessage(false, null, null);
            MoveScrollNode(Vector2.down, rect.sizeDelta.y, 1);
#endif
        }
Beispiel #2
0
        void ActivateKeyboard()
        {
#if UNITY_IPHONE && !UNITY_EDITOR
            _handleTouches = true;
            FIZZTouchScreenKeyboard.SetCustomMessage(true, OnMessageCallback, OnStickerCallback);
            if (_keyboard == null)
            {
                string _initialText = (_message.Equals(_placeholderText)) ? string.Empty : _message;
                _keyboard = FIZZTouchScreenKeyboard.Open(_initialText, FIZZTouchScreenKeyboardType.Default, true, true, false, false, _placeholderText);
            }
            else
            {
                _keyboard.active = true;
            }

            DeviceOrientation deviceOrientation = FizzUI.Instance.CanvasScaler.Orientation;
            if ((deviceOrientation == DeviceOrientation.PortraitUpsideDown || deviceOrientation == DeviceOrientation.Portrait) &&
                nodeToMove != null)
            {
                _moveUI = true;
            }
#elif UNITY_ANDROID && !UNITY_EDITOR
            _handleTouches = true;

            RemoveAllAndroidKBListener();
            FIZZKeyboard.OnDoneButtonPress = OnDoneButtonPress;
            FIZZKeyboard.OnCancel          = OnCancel;
            FIZZKeyboard.OnKeyboardClose   = OnKeyboardClose;
            FIZZKeyboard.OnKeyboardOpen    = OnKeyboardOpen;
            FIZZKeyboard.OnEmojiClicked    = OnEmojiClicked;

            string _initialText = (_message.Equals(_placeholderText)) ? string.Empty : _message;
            FIZZKeyboard.ShowKeyboard(_initialText, _placeholderText, false);
#endif
        }