Hi,
The solution above is decent -- and, more importantly, relatively easy to implement since it doesn't require any scripting. But it does have the behaviors that you mentioned.
If you were only using mouse, you could use the PointerEnter() event to play the sound, which won't play as soon as the response menu opens. But it will only play when you mouse over a button, not when you navigate to it using keyboard/joystick.
To play sounds for keyboard/joystick navigation, too, you'd want to point the Select() event to a custom script, typically on the response menu GameObject. The script would have two methods:
- PlayNavigationSound: Plays the navigation sound unless a bool variable has been set true. Point the Select() event to this method.
- OnEnable: (Invoked when the response menu is opened.) Sets the bool variable true for one frame, then sets it false.
alfa995 wrote: ↑Wed Jul 29, 2020 4:12 pmI think it'd also look nicer if the selected button remained selected after pressing it, and just disable navigation and further presses. Is there a way to do that that works with mouse and keyboard?
How would you want this to work? Normally, as soon as you click a response button, the response menu disappears.