Have dialogue restart in specific scenarios
Re: Have dialogue restart in specific scenarios
If the continue button has focus (i.e., in Unity UI terms, the EventSystem has selected it), then the EventSystem's Submit input will click it. By default, the Submit input is mapped to Return. This process is completely separate from UIButtonKeyTrigger, which listens for input and also issues a click without requiring the button to have focus.
-
- Posts: 82
- Joined: Wed Mar 31, 2021 6:48 pm
Re: Have dialogue restart in specific scenarios
I see, so how can I remove the focus on the "continue" button? It seems to be gone now because I unticked everything from trigger. That's why I thought the "Enter" key was no longer registering,
Re: Have dialogue restart in specific scenarios
When you open your pause menu, set focus to one of your pause menu buttons. Example:
By setting PixelCrushers.UIPanel.monitorSelection = false; (as described in How To: Pause Dialogue In Pause Menu), the continue button won't try to steal focus back.
Code: Select all
public void OpenPauseMenu() // (just example code)
{
pauseMenuWindow.SetActive(true);
EventSystem.current.SetSelectedGameObject(somePauseMenuButton);
}
-
- Posts: 82
- Joined: Wed Mar 31, 2021 6:48 pm
Re: Have dialogue restart in specific scenarios
Awesome! Thanks a ton for the help!
Re: Have dialogue restart in specific scenarios
Happy to help!