Page 2 of 2

Re: Have dialogue restart in specific scenarios

Posted: Wed Apr 14, 2021 8:25 pm
by Tony Li
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.

Re: Have dialogue restart in specific scenarios

Posted: Thu Apr 15, 2021 7:24 am
by soniclinkerman
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

Posted: Thu Apr 15, 2021 9:11 am
by Tony Li
When you open your pause menu, set focus to one of your pause menu buttons. Example:

Code: Select all

public void OpenPauseMenu() // (just example code)
{
    pauseMenuWindow.SetActive(true);
    EventSystem.current.SetSelectedGameObject(somePauseMenuButton);
}
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.

Re: Have dialogue restart in specific scenarios

Posted: Thu Apr 15, 2021 10:18 am
by soniclinkerman
Awesome! Thanks a ton for the help!

Re: Have dialogue restart in specific scenarios

Posted: Thu Apr 15, 2021 10:42 am
by Tony Li
Happy to help!