Mango Menus is a lightweight, generic menu system that handles stacking menus while managing focus.
The menu system needs the 'PanelManager' and at least 1 'Panel' to work properly.
The 'PanelManger' manages all present 'Panels' and executes the panel requests. No requests will be executed if the 'PanelManager' is not present in the scene but they will be queued and executed when a'PanelManager' instance gets available. Incoming requests will be executed each frame - one request. This approache makes it possible to send open requests in the close callbacks of 'Panels' whithout messing up the focus management of the 'PanelManager'.
In playmode it will display debuginformation. For example all available 'Panels' that registered in the 'PanelManager' and all currently open 'Panels' in the stack. All registered 'Panels' can be opened, closed and pinged in this editor for better debugging and testing.
The 'Panel' makes the gameObject identifiable for the 'PanelManager'. The 'Panel' references the 'Identifier' which is used to open it. The 'Panel' displays its current state and interact-ability in the editor for better debugging. To get messages for status changes like open/close, focus gained/lost and the initial open state implement the following interfaces: 'IPanelOpenHandler', 'IPanelCloseHandler', 'IPanelFocusGainedHandler' 'IPanelFocusLostHandler' and 'IPanelInitialzedHandler'. All components that implement this interfaces in the hierarchy of the 'Panel' will be automatically called. Be aware that this can happen before the Awake of the implementing component.
The 'Identifier' is a scriptable object in the project that is used to open and close panels. To open a 'Panel' reference the 'Identifier' in the project and call 'Identifier.RequestOpen()'. Differnt panels in different scenes can be linked to the same 'Identifier'. For example a 'PauseMenuIdentifier' can open different panels in different game modes / scenes. Every 'Panel references the 'Identifier' which will open the panel.




