> For the complete documentation index, see [llms.txt](https://october-studio.gitbook.io/monster-survivors-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://october-studio.gitbook.io/monster-survivors-documentation/input/menu-navigation.md).

# Menu Navigation

Starting with the version 1.0.2 of the template we use default ui navigation that comes with [Input System](https://docs.unity3d.com/Packages/com.unity.inputsystem@1.0/manual/UISupport.html).&#x20;

### Navigation Inside Pages

Every scene you want to have UI navigation in should have game object with the Input System UI Input Module Component attached.

<figure><img src="/files/ZM5CIWFdipGp6ErQyCH3" alt=""><figcaption></figcaption></figure>

For every page you must ensure the following:

1. It assigns a one of it's buttons as selected when opened using  `EventSystem.current.SetSelectedGameObject(button.gameObject);`&#x20;
2. Subscribe to the GameController.InputManager.onInputChanged event. If the new InputType is not UIJoystick, than assigns a one of it's buttons as selected again.
3. All of it's buttons can navigate only to each other. Use Navigation field of a Button Component.
4. Every Button Component that can be selected also has to have Highlightable Button UI Component.&#x20;

   <figure><img src="/files/sdLCTp81wGaM6KE1Im8M" alt=""><figcaption><p>Highlighted button</p></figcaption></figure>

### Button Highlights

If the active input type is Gamepad or Keyboard, the selected button that has Highlightable Button UI Component attached will be highlighted with two small animated arrows. \
The prefab for the arrows "Button Selection Arrow" is located here:<img src="/files/np3wEFlHuXnIfCmFv6f6" alt="" data-size="line">\
You can change it with any other image you want, animated or not.

The arrows are spawned inside Highlights Parent Canvas, that is a child of the Input Manager Game Object from the Main Menu scene. This canvas is drawn on top of every other canvases to prevent hierarchy from interfering with the arrows

<figure><img src="/files/qJA2X5dIjjFmkGkdGnkg" alt=""><figcaption></figcaption></figure>
