Beispiel #1
0
    public override void OnGameUpdate()
    {
        if (Input.GetKeyDown(KeyCode.Return) && !GameConsole.IsOpen())
        {
            if (_chatWindow.focused)
            {
                _chatWindow.focused = false;
                _chatWindow.ResetScroll();

                if (string.IsNullOrEmpty(_chatWindow.inputText) == false)
                {
                    ChatSystem.Instance.SubmitMessage(_chatWindow.inputText);
                    _chatWindow.inputText = string.Empty;
                }
            }
            else
            {
                _chatWindow.displayed = true;
                _chatWindow.focused   = true;
            }
        }

        if (_chatWindow.focused)
        {
            ResetInactivityTimer();
        }

        UpdateInactivityTimer();
    }