A class in Root.Township, Alta.Logic.
A logic receiver for a bool signal (for example a lever or button). Invokes events when the value changes and saves the sender's last value.
Constructors
| Member | What it is |
|---|
LogicBoolReceiver() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
3 private and internal fields
| Member | What it is |
|---|
private UnityEvent onActivate | Unity event invoked when the value turns true. |
private UnityEvent onDeactivate | Unity event invoked when the value turns false. |
private BoolUnityEvent onValueChanged | Unity event invoked with the new value on every change. |
Properties
| Member | What it is |
|---|
bool IsActive { get; } | Current bool value from the sender. |
Events
| Member | What it is |
|---|
event UnityAction Activated | Event raised when the value turns true. |
event UnityAction<bool> Changed | Event raised with the new value on every change. |
event UnityAction Deactivated | Meant for when the value turns false, but it subscribes to the activate event, so handlers run on activation instead. |
Methods
| Member | What it is |
|---|
protected override void ValueUpdated() | Invokes the changed event, then the activate or deactivate event. |
Used in
Members of other types that take, return or hold a LogicBoolReceiver: