Defines the available menu types (Main Menu, Settings, Credits) in a simple enumeration that can be easily extended.
The central hub that manages all menu GameObjects. It maintains a dictionary of registered menus and handles the core logic for showing/hiding different menu screens. This static class ensures menus are properly initialized and provides safe access to menu objects.
A component attached to each menu GameObject that automatically registers itself with the MenuController during the Awake phase. This creates a self-organizing system where menus don't need manual setup.
Handles the state transitions between different menus. It ensures only one menu is active at a time and provides smooth transitions by deactivating the current menu before activating the new one.
Provides simple methods that can be connected to UI buttons for menu navigation. Each method calls the appropriate state change through the MenuStateManager.
Sets up the entire menu system when the scene starts, initializing the MenuController and setting the default menu state.
The system follows a registration pattern where each menu automatically registers itself when the scene loads. The MenuController acts as a centralized manager, while the MenuStateManager handles the logic of switching between different menu states. Button clicks trigger state changes through the MenuButtonHandler, creating a clean separation of concerns that makes the system easy to maintain and extend.