UnitySignals
Signals for Unity3D
|
The empty Signal. Implements the ISignal interface. More...
Public Member Functions | |
void | AddListener (UnityAction listener) |
Adds a listener. | |
void | RemoveListener (UnityAction listener) |
Removes a listener. | |
void | TriggerUpdate () |
Invokes listeners. | |
void | AddListener (UnityAction< T > listener) |
Adds a listener. | |
void | RemoveListener (UnityAction< T > listener) |
Removes a listener. | |
void | TriggerUpdate () |
Invokes listeners. | |
Static Public Member Functions | |
static implicit | operator T (Signal< T > signal) |
Implicit cast from the Signal to it's Value. | |
Protected Member Functions | |
virtual void | ProcessValue (ref T value) |
Override this method to preprocess values before applying them. | |
virtual bool | ValidateValue (in T value) |
Override this method to check whether a value is valid and/or if it has changed. If UseValidation is true the Value is set only if this method returns true. | |
virtual void | OnEnable () |
Properties | |
T | InitialValue [get, set] |
The initial value of the Signal. | |
T | Value [get, set] |
The current value of the Signal. Setting the value invokes listeners. | |
bool | UseValidation [get, set] |
True if new values are validated, false otherwise. | |
![]() |
The empty Signal. Implements the ISignal interface.
Abstract base class for Signals inheriting from ScriptableObject. Implements the ISignal interface.
T | The type of the Value. |
void Signals.Signal< T >.AddListener | ( | UnityAction | listener | ) |
Adds a listener.
Implements Signals.ISignal< T >.
void Signals.Signal< T >.AddListener | ( | UnityAction< T > | listener | ) |
Adds a listener.
Implements Signals.ISignal< T >.
|
protectedvirtual |
|
static |
Implicit cast from the Signal to it's Value.
signal | The Signal. |
|
protectedvirtual |
Override this method to preprocess values before applying them.
value | The value to process |
void Signals.Signal< T >.RemoveListener | ( | UnityAction | listener | ) |
Removes a listener.
Implements Signals.ISignal< T >.
void Signals.Signal< T >.RemoveListener | ( | UnityAction< T > | listener | ) |
Removes a listener.
Implements Signals.ISignal< T >.
void Signals.Signal< T >.TriggerUpdate | ( | ) |
Invokes listeners.
Implements Signals.ISignal< T >.
void Signals.Signal< T >.TriggerUpdate | ( | ) |
Invokes listeners.
Implements Signals.ISignal< T >.
|
protectedvirtual |
Override this method to check whether a value is valid and/or if it has changed. If UseValidation is true the Value is set only if this method returns true.
value | The new value. |
|
getset |
The initial value of the Signal.
|
getset |
True if new values are validated, false otherwise.
|
getset |
The current value of the Signal. Setting the value invokes listeners.
Implements Signals.ISignal< T >.