Automatically scrolls a ScrollRect to the currently selected UI element
1 Overview
3 Methods
4 Usage
6 See also
A ScrollRect enhancement that automatically scrolls to the currently selected UI element, useful for keyboard/gamepad navigation.
The properties of the UIScrollToSelection control are as follows:
| Property | Description |
|---|---|
| Viewport Rect Transform | View (boundaries/mask) rect transform. Used to check if automatic scroll to selection is required |
| Target Scroll Rect | Scroll rect used to reach selected element |
| Scroll Axes | Allow automatic scrolling only on these axes |
| Used Scroll Method | MOVE_TOWARDS: stiff movement, LERP: smoothed out movement |
| Scroll Speed | Speed at which the scroll rect moves to the selected element |
| End Of List Jump Scroll Speed | Scroll speed used when element to select is out of “JumpOffsetThreshold” range |
| Jump Offset Threshold | If next element to scroll to is located over this screen percentage, use “EndOfListJumpScrollSpeed” to reach this element faster |
| Cancel Scroll Mouse Buttons | Mouse buttons that cancel the automatic scrolling |
| Cancel Scroll Keys | Keyboard keys that cancel the automatic scrolling |
This component does not expose public methods beyond inherited behaviour.
Simply add the component to a ScrollRect using:
“Add Component -> UI -> Extensions -> UIScrollToSelection”
N/A
zero3growlithe