× Phaseshift FCOM Tutorials

MenuManager



MenuManager is responsible for keeping track of the MainMenu state.

The MenuManager is responsible for keeping tabs on all the menus within the MainMenu, and Gameplay scene. In the Gameplay scene it keeps track of the PauseMenu state.

MenuManager can be used to set up codeless navigation to scenes and other menus. First, the MenuManager needs to be aware of all UI_Menu instances within the scene. This includes all menus and submenus even if the menu itself contains no UI elements and just holds their respective submenus. 

Note

As of 1.0.0, all menus must be set to active by default to enable all UI elements to be correctly initialised. MenuManager will then show and hide the appropriate menu depending on which menu has been set as 'StartingMenu' in the Inspector.

Using MenuManager in code

MenuManager can be accessed from anywhere via its singleton like below:


Liked this article?

Please consider sharing!
Author

Josh Lyell

Game Developer