MenuBuilder
A menu system for Unity projects. Create complex menus without writing a single line of code
Install / Use
/learn @hfjooste/MenuBuilderREADME
Menu Builder for Unity
License
You are free to do whatever you want with this library. You're allowed to use this for commercial projects, edit the source code and even redistribute the source code. No attribution is required (but appreciated)
Requirements
- Unity 2020.3.11f1
- Unity Input System
Features
This tool allows you to create complex menus without writing a single line of code. It includes to following features
<ol> <li>Keyboard and controller support using the Unity Input System</li> <li>Vertical, Horizontal and Tabbed style menus</li> <li>Wrap-around when exceeding the start/end positions</li> <li>Activated, deactivated, selected and canceled events that can be handled inside the editor</li> </ol>Setting up the input
This library includes demo input actions that should be perfect for any game. If you want to create your own, you can follow these steps:
<i>Please refer to the official Unity documentation for more information: https://docs.unity3d.com/Packages/com.unity.inputsystem@1.0/manual/QuickStartGuide.html</i>
Default input
<table> <tr> <th>Action</th> <th>Keyboard</th> <th>Controller</th> </tr> <tr> <td>Navigate Up</td> <td>Up Arrow<br/>W Key</td> <td>Left Stick Up<br/>D-Pad Up</td> </tr> <tr> <td>Navigate Down</td> <td>Down Arrow<br/>S Key</td> <td>Left Stick Down<br/>D-Pad Down</td> </tr> <tr> <td>Navigate Left</td> <td>Left Arrow<br/>A Key</td> <td>Left Stick Left<br/>D-Pad Left</td> </tr> <tr> <td>Navigate Right</td> <td>Right Arrow<br/>D Key</td> <td>Left Stick Right<br/>D-Pad Right</td> </tr> <tr> <td>Tab Previous</td> <td>Q Key<br/>Page Down</td> <td>Left Trigger</td> </tr> <tr> <td>Tab Next</td> <td>E Key<br/>Page Up</td> <td>Right Trigger</td> </tr> <tr> <td>Select</td> <td>Enter Key</td> <td>South Button</td> </tr> <tr> <td>Cancel/Back</td> <td>Escape Key</td> <td>East Button</td> </tr> </table><br/>Handling input inside the scene

This <b>Menu Input</b> component will read the input from the Unity Input System (using the InputActions file) and invoke the correct events when needed
Creating a menu

Creating a menu item

<i>Remember to add the menu item to the menu. Otherwise no events will be invoked</i>
Creating input indicators

<i>The Menu Device Monitor requires an instance of Menu Input in the same scene</i>
Demo
This library includes a demo scene that shows you how to create vertical, horizontal and tabbed menus. It also includes different menus using different features available in the library (including device/input indicators). There's a <b>Input</b> directory that contains an <b>InputActions</b> file that should be perfect for your game
