Handy Selectable script to un-highlight a selectable component in Unity (e.g. a Button) when the user moves away from it, EVEN IF the user has holding a button on it.
Resolves the situation where Unity UI Components remain in a highlighted state even after the pointer has moved away (e.g. user holding a button, mouse, pointer down). Now whenever the cursor leaves the component, it will force the UI component to revert to un-highlighted.
1 Overview
3 Methods
4 Usage
6 See also
An addon component that forces a Selectable Control (Button, InputField, etc) to reset its highlighted state whenever the mouse cursor leaves the control.
By default in the Unity UI, if a pointer is held down when the cursor leaves the control, it remains in a highlighted state.
Button on the left has the ResetSelectableHighlight component, while the button on the right is a default Unity UI Button, Mouse is held down when moving off the control.
This control has no configurable properties in the inspector.
This component does not expose public methods beyond inherited behaviour.
Use as follows:
"Add Component -> UI -> Extensions -> ResetSelectableHighlight"
This will add the ResetSelectableHighlight component to the selected GameObject.
No config required.
N/A
N/A
SimonDarksideJ
N/A
