Ejemplo n.º 1
0
        private void Update()
        {
            if (Input.GetButtonDown("Toggle Dev Command Console") &&
                (!InputFocusManager.Instance.IsAnyInputFieldInFocus() || InputFocusManager.Instance.IsInputFieldInFocus(TextInputField)))
            {
                ShowConsole = !ShowConsole;
                if (ShowConsole)
                {
                    TextInputField.ActivateInputField();
                }
                else
                {
                    TextInputField.DeactivateInputField();
                }
            }

            if (TextInputField.isFocused)
            {
                if (Input.GetKeyDown(KeyCode.UpArrow))
                {
                    OnHistoryUpClicked();
                    TextInputField.MoveTextEnd(false);
                }

                if (Input.GetKeyDown(KeyCode.DownArrow))
                {
                    OnHistoryDownClicked();
                    TextInputField.MoveTextEnd(false);
                }
            }
        }