A class in Root.Township, Alta.Meta.UI.
Exposes a game Button's press, release and enabled changes as Unity events for wiring in the inspector.
Constructors
| Member | What it is |
|---|
ButtonEvents() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
5 private and internal fields
| Member | What it is |
|---|
private Button button | The button, filled from the same object by default. |
private UnityEvent onDisable | Fired when the button becomes disabled. |
private UnityEvent onEnable | Fired when the button becomes enabled. |
private UnityEvent onPress | Fired when the button is pressed. |
private UnityEvent onRelease | Fired when the button is released. |
Methods
2 private and internal methods
| Member | What it is |
|---|
private void Awake() | Hooks the button's pressed, released and enabled-changed events to the Unity events. |
private void HandleEnabledChanged(Button button) | Fires onEnable or onDisable to match the button's new state. |