protected virtual bool IsUseButtonDown() { if (DialogueManager.IsDialogueSystemInputDisabled()) { return(false); } // First check for button down to remember what was selected at the time: if (!string.IsNullOrEmpty(useButton) && DialogueManager.getInputButtonDown(useButton)) { clickedDownOn = selection; } // Check for use key or button (only if releasing button on same selection): if ((useKey != KeyCode.None) && InputDeviceManager.IsKeyDown(useKey)) { return(true); } if (!string.IsNullOrEmpty(useButton)) { if (DialogueManager.instance != null && DialogueManager.getInputButtonDown == DialogueManager.instance.StandardGetInputButtonDown) { return(InputDeviceManager.IsButtonUp(useButton) && (selection == clickedDownOn)); } else { return(DialogueManager.GetInputButtonDown(useButton)); } } return(false); }
void Update() { if (Input.GetKeyDown(key) || (!string.IsNullOrEmpty(buttonName) && DialogueManager.GetInputButtonDown(buttonName))) { var pointer = new PointerEventData(EventSystem.current); ExecuteEvents.Execute(button.gameObject, pointer, ExecuteEvents.submitHandler); } }
protected bool IsUseButtonDown() { // First check for button down to remember what was selected at the time: if (!string.IsNullOrEmpty(useButton) && DialogueManager.GetInputButtonDown(useButton)) { clickedDownOn = selection; } // Check for use key or button (only if releasing button on same selection: return(((useKey != KeyCode.None) && Input.GetKeyDown(useKey)) || (!string.IsNullOrEmpty(useButton) && Input.GetButtonUp(useButton) && (selection == clickedDownOn))); }
/// <summary> /// Checks whether the player has just pressed the use button. /// </summary> /// <returns> /// <c>true</c> if the use button/key is down; otherwise, <c>false</c>. /// </returns> protected virtual bool IsUseButtonDown() { if (DialogueManager.IsDialogueSystemInputDisabled()) { return(false); } if (enableTouch && IsTouchDown()) { return(true); } return(((useKey != KeyCode.None) && Input.GetKeyDown(useKey)) || (!string.IsNullOrEmpty(useButton) && DialogueManager.GetInputButtonDown(useButton))); }
void Update() { if (Input.GetKeyDown(key) || (!string.IsNullOrEmpty(buttonName) && DialogueManager.GetInputButtonDown(buttonName))) { if (questLogWindow.IsOpen) { questLogWindow.Close(); } else { questLogWindow.Open(); } } }