Navigation
UI Navigation Container
Manage tab order, selection recovery, and navigation boundaries
Overview
UI Navigation Container coordinates keyboard and controller selection inside a panel. It combines the old Tab Navigation and UI Navigation Fallback workflows.
Usage
Add the component to a panel containing Selectables.
Enable Auto Fetch On Enable, or populate Interactive Elements yourself.
Choose hierarchy or positional tab order and whether navigation wraps.
Set a default selection and a recovery policy for invalid or lost selection.
Exclude controls that should not appear in the tab order.
Tips
- Restrict Navigation keeps directional navigation within the container.
- Select On Enable controls initial selection; Ensure Selection restores selection when needed.
- Restore Selection On Disable returns focus when the panel closes.
Notes
The EventSystem must use InputSystemUIInputModule.
Public API
Use UINavigationContainer in the Evo.UI namespace.
Fields
| Name | Type | Description |
|---|---|---|
interactiveElements | List<Selectable> | Controls managed by this container. |
excludedFromTabOrder | List<Selectable> | Controls skipped by tab navigation. |
tabOrder | TabOrder | Hierarchy or Position ordering. |
wrapAround | bool | Wraps tab navigation at the ends. |
defaultSelection | Selectable | Preferred initial/default control. |
fallbackSelection | Selectable | Fallback when recovering selection. |
ensureSelection | bool | Keeps a valid selection when possible. |
Methods
| Name | Parameters | Description |
|---|---|---|
RefreshNavigation() | None | Refreshes collected controls and navigation. |
FetchInteractables() | None | Collects Selectables. |
ApplyNavigationRestrictions() | None | Applies container boundaries. |
RestoreNavigation() | None | Restores original navigation settings. |
SelectDefault() | None | Attempts to select the default control. Returns bool. |
RestoreSelection() | None | Attempts recovery using the configured policy. Returns bool. |
TabToNext() | bool reverse = false | Moves forward; pass true to move backward. |
Example
using UnityEngine;
using Evo.UI;
public class UINavigationContainerExample : MonoBehaviour
{
[SerializeField] private UINavigationContainer target;
private void Start()
{
target.RefreshNavigation();
target.SelectDefault();
}
}