Skip to main content

LogicBoolReceiver

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​

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

Fields​

3 private and internal fields
MemberWhat it is
private UnityEvent onActivateUnity event invoked when the value turns true.
private UnityEvent onDeactivateUnity event invoked when the value turns false.
private BoolUnityEvent onValueChangedUnity event invoked with the new value on every change.

Properties​

MemberWhat it is
bool IsActive { get; }Current bool value from the sender.

Events​

MemberWhat it is
event UnityAction ActivatedEvent raised when the value turns true.
event UnityAction<bool> ChangedEvent raised with the new value on every change.
event UnityAction DeactivatedMeant for when the value turns false, but it subscribes to the activate event, so handlers run on activation instead.

Methods​

MemberWhat 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: