Skip to main content

ButtonWithEvents

A class in Root.Township, Alta.Meta.UI.

A menu Button that also fires Unity events set in the inspector when pressed, released, enabled or disabled.

Constructors​

MemberWhat it is
ButtonWithEvents()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

4 private and internal fields
MemberWhat it is
private UnityEvent onDisableInspector event invoked when the button becomes disabled.
private UnityEvent onEnableInspector event invoked when the button becomes enabled.
private UnityEvent onPressInspector event invoked when the button is pressed.
private UnityEvent onReleaseInspector event invoked when the button is released.

Methods​

MemberWhat it is
protected virtual void Awake()Hooks the press, release and enabled change events to the inspector Unity events.
1 private and internal method
MemberWhat it is
private void HandleEnabledChanged(Button obj)Invokes onEnable or onDisable when the button's enabled state changes.

Used in​

Members of other types that take, return or hold a ButtonWithEvents: