Menu Screen Flow
Use this graph when exactly one menu screen should be active and button clicks should make the permitted navigation paths explicit.
In the editor
- Put the State Machine on a persistent Menu Controller rather than on a panel that the graph will disable.
- Add three Action States named Show Main Menu, Show Options, and Show Credits, plus three standalone Idle states named Main Menu, Options, and Credits. Connect Start to Show Main Menu.
- In each Show state, use Set Active Actions in Sequence to enable its panel and disable the other panels. Connect that state to its matching Idle state with State Finished. Idle is a state node and cannot be added to the Action list.
- Connect Main Menu to Show Options and Show Credits. Replace each transition’s default State Finished with On Button Clicked and assign the matching button GameObject.
- Connect Options and Credits back to Show Main Menu. Replace State Finished on both transitions with On Button Clicked and assign their Back buttons.
- Use Continuous evaluation for each button transition. Keep State Finished on the three Show-to-Idle transitions.
The supplied UIMenu sample uses State Designer Actions and On Button Clicked Conditions to coordinate UI behavior. Its graph is a useful reference after importing the sample content.
How it runs
Each Show state activates its panel and disables the others, then enters the corresponding Idle state. That waiting state remains Running while its outgoing button Conditions listen. A button click starts the next Show state, which updates the visible panels before entering its waiting state.
Because navigation is represented by connections, the graph also documents which screens are reachable from each current screen. A modal confirmation can be another state with only Confirm and Cancel transitions.
Key choices
- Keep the State Machine outside every panel it controls. Disabling its own GameObject stops the graph.
- Keep one waiting state per mutually exclusive screen, with an entry Action State for its panel setup. Use parallel Actions in the setup state for independent effects that should begin together.
- Use unscaled-time Actions for transitions that must animate while gameplay time is paused.
- Use an Any transition sparingly for a global Close command; ordinary Back transitions preserve the intended navigation rules more clearly.
Verify in Play Mode
Click Options, Back, Credits, and Back. Each click should follow one navigation route through the destination Show Action State and into its matching Idle state. Confirm that exactly one panel remains active once the setup Actions finish.