private void Update() { if (Input.GetKeyDown(Shortcuts.SEND_MESSAGE)) { if (input.IsInteractable() && IsMessageValid) { AddMessage(input.text); input.text = string.Empty; } input.interactable = !input.interactable; if (input.IsInteractable()) { input.Select(); } } }
private void ToggleChatInput() { if (chatInput.IsInteractable()) { chatInput.interactable = false; chatting = false; } else { chatting = true; chatInput.interactable = true; chatInput.ActivateInputField(); } }
// Update is called once per frame void Update() { bool newInteractable = text.IsInteractable(); if (newInteractable != interactable) { miniLabel.color = newInteractable ? miniLabelColor : disabledColor; label.color = newInteractable ? labelColor : disabledColor; inputText.color = newInteractable ? inputTextColor : disabledColor; } interactable = newInteractable; }