SelectableCollection
A Selectable Collection is a helper class to group sets of Selectables.
They are used to define the Selectables inside a Navigation Group, the Root Selectables in the Better Navigation component, the tabs in the Tab Switch Controller as well as inside the Better Scroll Rect to keep the current selection in view when navigating with the gamepad.
Remember Previous Selectable
When this option is checked and the collection becomes re-focused (e.g. another Navigation Group was closed and the Previous Navigation Group that holds this Selectable Collection gains focus again), the selectable in this collection that was selected before becomes selected again.
Note that this option is ignored when the collection gained focus through smart select (See Navigation Group Switch Controller and Tab Switch Controller)
If this option is not checked, it will determine and use the Initial Selectable.
Initial Selectable
There are several options to determine the selectable that is selected when the group gains focus (for the first time):
- First In Hierarchy
The upper-most selectable in the hierarchy structure beneath the game object with the Selectable Group is selected. - Last In Hierarchy
The lower-most selectable in the hierarchy structure beneath the game object with the Selectable Group is selected. - Specific
Allows to specify a certain selectable. This should only be used if that selectable is always active and interactable when the Selectable Group has focus. - Closest To Coordinate
Allows to specify a relative coordinate ( {0,0} - {1,1} ). It is relative to the RectTransform where the Selectable Group is part of. - Closest To Previous Selection
Tries to find the selectable that is the closest to the Selectable that was selected before this Selectable Collection got focused. - Keep Previous Selection
Does not select any selectable of the collection and instead does nothing (the previous selection remains, even if it is not part of a focused group). - Highest Priority
For Selectable Collections, this is the same as First In Hierarchy. (For Navigation Group Collections it works differently)
Collection Strategy
The "Collection Strategy" defines when selectables are added to the collection.
For the first two options, all Selectables within the hierarchy of the game object that holds the Selectable Collection will be included.
- Collect On Initialization
The Selectables are collected once when it becomes enabled for the first time. They will not change when selectables are added or removed.
This is a good choice if the UI is not dynamic and will never change. - Collect When Dirty
If Better Navigation detected a change of selectables since the last time the collection was accessed, the selectables are collected again.
This option should be used for dynamic UIs where Selectables are added or removed during runtime. - Fixed Set
The Selectables are specified by the user and will never be changed.
This option is perfect if you want to exclude certain selectables from navigation or include selectables that are in a different hierarchy-branch.