Skip to content

nementic-games/mango-menus

Repository files navigation

Mango Menus

Mango Menus is a lightweight, generic menu system that handles stacking menus while managing focus.

Setup

The menu system needs the 'PanelManager' and at least 1 'Panel' to work properly.

Preview: Example for a scene setup with all requiered systems('PanelManager' and 'Panels').

PanelManager

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'.

Preview: PanelManager in editmode.

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.

Preview: PanelManager in playmode

Panel

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.

Preview: 'Panel' component in the editor in editmode. Preview: 'Panel' component in the editor in playmode

Identifier

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.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages