コード例 #1
0
        public void Hide()
        {
            isVisible = false;

            canvas.enabled           = isVisible;
            graphicRaycaster.enabled = isVisible;

            consoleInput.OnDeselect(null);
        }
コード例 #2
0
 private void RefreshText(InputActionRebindingExtensions.RebindingOperation operation)
 {
     keybindInputField.text = operation.action.GetBindingDisplayString().Split('|')[0];
     keybindInputField.DeactivateInputField(true);
     keybindInputField.OnDeselect(new BaseEventData(EventSystem.current));
     keybindInputField.interactable = false;
     keybindInputField.interactable = true;
     operation.Dispose();
     action.Enable();
 }
コード例 #3
0
        public void Submit(bool resumeTyping = true)
        {
            RunCommand(inputField.text);

            // Clear the inputfield
            inputField.text = string.Empty;
            if (resumeTyping)
            {
                inputField.Select();
                inputField.ActivateInputField();
            }
            else
            {
                EventSystem.current.SetSelectedGameObject(null);
                inputField.OnDeselect(null);
            }
        }
コード例 #4
0
        /// <summary>
        /// Closes the console.
        /// </summary>
        public void Close()
        {
            IsOpen = false;

            //Disable the canvas group
            canvasGroup.alpha          = 0.0f;
            canvasGroup.interactable   = false;
            canvasGroup.blocksRaycasts = false;

            //Disable the input field
            inputField.interactable = false;
            inputField.OnDeselect(null);
            EventSystem.current.SetSelectedGameObject(null);

            //Clear the input field of the key used to open/close the console
            inputField.text = inputField.text.Replace("`", string.Empty);
        }