Skip to content

Commit 9f0d981

Browse files
Added ResetSelectableHighlight documentation
1 parent c21e715 commit 9f0d981

2 files changed

Lines changed: 46 additions & 0 deletions

File tree

663 KB
Loading
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# ResetSelectableHighlight
2+
3+
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.
4+
5+
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).
6+
Now whenever the cursor leaves the component, it will force the UI component to revert to un-highlighted.
7+
8+
---------
9+
10+
## Contents
11+
12+
> 1 [Overview](#overview)
13+
>
14+
> 2 [Usage](#usage)
15+
>
16+
> 3 [Credits and Donation](#credits-and-donation)
17+
18+
---------
19+
20+
## Overview
21+
22+
An addon component that forces a Selectable Control (Button, InputField, etc) to reset its highlighted state whenever the mouse cursor leaves the control.
23+
24+
> By default in the Unity UI, if a pointer is held down when the cursor leaves the control, it remains in a highlighted state.
25+
26+
![Demo comparing the ResetSelectable against the default Unity UI Behaviour](Images/ResetSelectableHighlight-demo.gif)
27+
28+
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.
29+
30+
---------
31+
32+
## Usage
33+
34+
Use as follows:
35+
36+
* "Add Component -> Extensions -> *ResetSelectableHighlight*"
37+
38+
This will add the ResetSelectableHighlight component to the selected GameObject.
39+
40+
> No config required.
41+
42+
---------
43+
44+
## Credits and Donation
45+
46+
SimonDarksideJ

0 commit comments

Comments
 (0)