Main Menu
Use Main Menu as a shared navigation shell for Inventory screens such as Bag, Equipment, Shop, Crafting, and Save/Load. Each tab maps one Action Button to one inner Display Panel, while the Display Panel Manager opens and closes the shell for the correct player.
Main Menu does not own Inventory data. Bag, Equipment, and every other subpanel keep their own Inventory, Item Collection, Shop, Crafter, or Save bindings. Main Menu only decides which mapped subpanel is active.
Before you begin
Confirm that the scene has:
- an EventSystem;
- a Display Panel Manager under the intended player’s Canvas;
- a valid Panel Owner, or a Panel Owner Inventory Identifier ID that resolves the player;
- a Gameplay Panel if opening Main Menu should replace the normal gameplay HUD; and
- the data and runtime components required by each intended subpanel.
For a small test, create a player Inventory with Bag and Equipment collections. Put Health Potion and Iron Sword in Bag, and configure Equipment with a Weapon slot that accepts Iron Sword.
Create or select the Main Menu
Most UI Designer schemas already include a Main Menu. Select the existing menu under Edit when it is the intended shell; creating another one changes the manager reference but does not remove the old menu or its opener.
When a new shell is required:
- Open Tools > Opsive > Ultimate Inventory System > UI Designer.
- Select Main Menu and open Create.
- Set Parent Transform below the intended Display Panel Manager.
- Set Panel name to a unique value such as
Inventory Main Menu. The creation default isMain Menu. - Leave Vertical on for the vertical schema prefab, or turn it off for the horizontal prefab. It is on by default.
- Select Create.
- Confirm that the Display Panel Manager’s Main Menu Panel references the generated Display Panel.
- If Gameplay Panel was assigned before creation, confirm that its Main Content contains a generated Main Menu Action Button.
UI Designer wires that gameplay button to the generated Display Panel’s smart-open flow. If no Gameplay Panel existed during creation, add a project input or button that opens the manager’s Main Menu Panel.
Configure the Main Menu component
Select the generated Main Menu. The component maps controls to inner panels:

| Inspector field | Manual Version 1 default | Use |
|---|---|---|
| Panels | Empty | Ordered Panel/Button pairs. List order controls first, previous, and next subpanel behavior. |
| Close Button | None | Closes the Main Menu Display Panel and returns to its previous panel or selectable. The schema prefab assigns this. |
| Quit Button | None | Calls Application.Quit when submitted. The schema prefab may assign this. |
| Menu Tabs | None | Parent Rect Transform for generated tab buttons. The schema prefab assigns this. |
| Menu Open Options | Open Previous Sub Menu | Chooses which mapped panel opens with the shell. |
Every Panels entry needs both a non-null Display Panel and Action Button. The Main Menu subscribes to each button’s submit event during initialization. A click, keyboard submit, or controller submit therefore opens the paired panel through the same path.
The generated Main Menu Display Panel uses these important settings:
- Is Menu Panel is on, so the manager treats it as the active menu;
- Start Enabled and Open On Start are off;
- Set Active On Open and Set Disable On Close are on; and
- Unique Name must be unique under its Display Panel Manager.
Add Bag and Equipment subpanels
Create subpanels through their own UI Designer tabs so their data bindings and Main Menu mapping are created together.
Add Bag
- In UI Designer, select Inventory Grid.
- Set Parent Transform to the Main Menu Display Panel’s Main Content.
- Set Panel Option to Main Menu.
- Name the panel and grid
Bag, assign the player Inventory, and configure its filter or Item Collection behavior. - Create the grid and confirm that Main Menu gains a Bag Panel/Button pair.
Add Equipment
- In UI Designer, select Equipment.
- Use the same Main Menu Main Content as Parent Transform.
- Set Panel Option to Main Menu and name the panel
Equipment. - Assign the player Inventory and the Item Slot Set used by the Equipment Item Collection.
- Create the view and confirm that Main Menu gains an Equipment Panel/Button pair.
Use the same pattern for Shop, Crafting, Save/Load, and other supported panels. In the Main Menu Edit section, adding an entry directly creates a BlankSubPanel and matching button for project-specific content.

UI Designer’s generated inner-panel prefab uses Is Menu Panel off, Set Active On Open on, and Set Disable On Close off. That last setting is deliberate: Main Menu explicitly closes and deactivates every non-selected mapped panel when switching tabs. The Main Menu shell, rather than each inner Display Panel alone, owns tab visibility.
Keep the inner panels in the Main Menu’s Main Content and leave them as non-menu panels. Marking each inner panel as a menu would make the Display Panel Manager treat tab changes as separate menu openings.
Keep list order and tab order aligned
In UI Designer’s Main Menu Edit section:
- Review Main Menu Sub Panels.
- Select each entry and compare its Panel name and Button text.
- Use Select Panel and Select Button to locate the paired objects.
- Reorder the list into the intended runtime order.
- Reorder the children beneath Menu Tabs into the same visual order.
UI Designer inserts a newly generated tab button at sibling index 0, but appends its Panel/Button pair to the list. After adding several panels, the visible button order can therefore be the reverse of the list order. Open First Sub Menu, OpenPrevious(), and OpenNext() use the list, not the hierarchy.
Removing an entry with UI Designer destroys its generated panel and button as well as the mapping. Use Select Panel and Select Button before confirming removal.
Choose what opens with the menu
Set Menu Open Options according to the desired return behavior:
| Option | Runtime result | Good use |
|---|---|---|
| Open Previous Sub Menu | Reopens the last selected list entry. On the first open, the runtime index starts at 0. |
Return the player to their recent tab. |
| Open First Sub Menu | Opens list index 0 every time. |
Always start on Bag. |
| Open No Sub Menu | Closes and deactivates every mapped subpanel. | Show only the shell until the player chooses a tab. |
For the Bag and Equipment example, put Bag at list index 0 and use Open First Sub Menu. Confirm that the first visible tab is also Bag after matching the Menu Tabs hierarchy to the list.
OpenPrevious() and OpenNext() move one list entry without wrapping. They do nothing at the first and last entries respectively.
Understand ownership and panel flow
The Display Panel Manager owns the panel session:
- it resolves Panel Owner directly or through Panel Owner Inventory Identifier ID;
- it registers every child Display Panel and its Unique Name;
- it opens Main Menu Panel as a menu and closes the selected Gameplay Panel;
- Main Menu applies Menu Open Options and opens one mapped inner panel;
- each inner panel resolves and presents its own data; and
- closing Main Menu closes the selected subpanel and reopens the previous panel or selectable.
Main Menu passes itself as the previous panel when it opens a subpanel. Switching tabs closes every other mapped panel without selecting its previous control, deactivates it, and then opens the requested panel with its mapped Action Button as the previous selectable.
The manager-wide settings also apply:
- Set Time Scale To Zero When Menu Is Opened pauses and restores scaled time around menu state;
- Close Menu When Opening Another closes the current menu before opening a new one; when off, the manager refuses the second menu; and
- Enable Input On Gameplay Selected sends gameplay-input enable or disable events when focus enters or leaves Gameplay Panel.
For local multiplayer, give each player’s Display Panel Manager a distinct ID, Panel Owner, EventSystem ownership, Canvas, Main Menu Panel, and bound Inventory. Main Menu has no independent player ID; it inherits context from the manager and the bindings on its subpanels.
Editor checkpoint
Before entering Play Mode, confirm that:
- one intended Display Panel Manager owns this Main Menu and resolves the correct Panel Owner;
- Gameplay Panel and Main Menu Panel reference the intended Display Panels;
- the Main Menu shell has Is Menu Panel on and a unique Unique Name;
- the shell’s Close Button, optional Quit Button, and Menu Tabs references are valid;
- every Panels entry contains the matching inner panel and tab button;
- the Main Menu Sub Panels list and Menu Tabs hierarchy use the intended matching order;
- Bag is index
0when Open First Sub Menu should start there; - inner panels are beneath Main Content, have Is Menu Panel off, and use the intended generated close behavior;
- Bag and Equipment bind to the same player Inventory and their intended Item Collections;
- Equipment uses the correct Item Slot Set and accepts Iron Sword while rejecting Health Potion;
- each inner panel has a visible Selectable On Open or deliberate navigation path; and
- there is only one intended gameplay opener for this Main Menu.
Verify in Play Mode
- Open Main Menu through the generated gameplay button or project input.
- Confirm that Gameplay Panel closes and Bag opens first with Health Potion and Iron Sword.
- Submit the Equipment tab with pointer, keyboard, and controller. Confirm that Bag deactivates, Equipment opens, and focus remains visible.
- Equip Iron Sword and confirm that Bag and Equipment update without closing the Main Menu shell.
- Return to Bag and confirm that it reflects the same Inventory state.
- Close and reopen Main Menu. Confirm that Menu Open Options chooses the previous tab, list index
0, or no tab exactly as configured. - Open every additional Shop, Crafting, or Save/Load tab and verify its own data flow.
- Try to open another standalone menu and confirm that Close Menu When Opening Another produces the intended close-or-refuse behavior.
- Close Main Menu and confirm that the selected subpanel closes, Gameplay Panel and its previous selection return, time scale is restored, and gameplay input is enabled as configured.
- In a built player, test Quit separately.
Application.Quitdoes not stop Unity Editor Play Mode.
Save and network boundaries
Main Menu keeps the selected panel index only in memory. It does not save the open tab, Action Button selection, previous panel, or previous selectable. Save the authoritative Inventory, Equipment, Gold, crafting, and other subpanel data through their supported savers, then redraw or reopen the panel after loading.
The Main Menu and Display Panel Manager do not replicate panel state or authorize Inventory transactions. In a networked game, keep menu selection local, synchronize the authoritative data used by each subpanel, and ensure the local player’s manager owns the correct UI. Opening Equipment locally does not equip an Item on the network.
Troubleshooting
| Symptom | Check | Fix |
|---|---|---|
| The UI disables itself during initialization | Panel Owner and Panel Owner Inventory Identifier ID | Assign the player directly or use an ID that resolves an Inventory Identifier. |
| Main Menu does not open | Display Panel Manager Main Menu Panel, EventSystem, and another active menu | Assign the generated shell, verify its manager, and apply the intended close-or-refuse setting. |
| No gameplay opener was generated | Whether Gameplay Panel was assigned before Main Menu creation | Assign it before generation, or add a button/input that calls the Main Menu open flow. |
| The wrong or duplicate Main Menu opens | Multiple generated shells, opener buttons, and Main Menu Panel | Keep one deliberate manager reference and remove obsolete generated UI manually. |
| A tab opens the wrong panel | Main Menu Sub Panels Panel/Button pairs | Use Select Panel and Select Button to repair the mismatched entry. |
| The wrong tab opens first | Menu Open Options and list index 0 |
Reorder the list; do not rely on the visible hierarchy order alone. |
| Visible tab order and next/previous order disagree | Menu Tabs sibling order versus Panels list order | Reorder both structures into the same sequence. |
| Several inner panels remain visible | Missing mappings or custom panel activation | Add every tab destination to Panels and let Main Menu switch those mapped panels. |
| A subpanel is treated as another menu | Inner Display Panel Is Menu Panel | Turn it off for Main Menu children. Keep it on only for the shell. |
| Bag or Equipment shows the wrong character | manager Panel Owner and each subpanel Inventory binding | Bind every panel to the same intended player’s Inventory. |
| Keyboard or controller focus disappears | EventSystem, Selectable On Open, Action Button navigation, and null mappings | Assign a visible default selectable and repair the tab navigation. |
| Closing does not restore gameplay | shell Set Disable On Close, previous panel, time-scale, and input settings | Close through the Main Menu/manager flow and verify the same manager owns Gameplay Panel. |
| A duplicate-name warning appears | child Display Panel Unique Name values | Give every registered Display Panel a unique nonempty name. |
| Quit does nothing in Play Mode | Unity Editor versus built player | Test Application.Quit in a development build. |
Related pages
- Build and edit Main Menu in UI Designer
- Display Panel and Manager
- Item View Slots Container
- Shop Menu
- Crafting Menu
- Save Menu
- Storage Menu
- Inventory
- Input handlers
- Save system
Developer details
Open the shell through its manager so menu exclusivity, gameplay-panel state, Panel Owner events, time scale, and previous selection are handled consistently:
public void ToggleInventoryMenu()
{
displayPanelManager.ToggleMainMenu();
}
public void ShowBag()
{
mainMenu.OpenSubPanel(0);
}
MainMenu.Initialize(DisplayPanel, bool) subscribes each mapped Action Button’s OnSubmitE to OpenSubPanel(index). It also binds Close Button submit to DisplayPanel.Close(true) and Quit Button submit to Application.Quit.
OpenSubPanel(int) records the requested index, closes and deactivates every other mapped panel, and opens the selected panel with the Main Menu Display Panel and paired Action Button as its previous context. An index below 0 or beyond the list closes all mapped panels and opens none.
OnOpen() applies MenuOpenOptions. OnClose() closes the currently selected subpanel without selecting its previous control. OpenPrevious() and OpenNext() change the selected list index without wrapping.
Display Panel Manager exposes OpenMainMenu(), CloseMainMenu(), ToggleMainMenu(), OpenPanel(DisplayPanel), OpenPanel(string), ClosePanel(string, bool), and TogglePanel(DisplayPanel). Prefer those manager paths to setting GameObjects active directly.