UnitySignals
Signals for Unity3D
Loading...
Searching...
No Matches
Signals.Signal< T > Class Template Referenceabstract

The empty Signal. Implements the ISignal interface. More...

Inheritance diagram for Signals.Signal< T >:
Signals.ISignal< T > Signals.ISignal< T > Signals.Extras.Engine.EngineSettingsSignal< T >

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

InitialValue [get, set]
 The initial value of the Signal.
 
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.
 
- Properties inherited from Signals.ISignal< T >

Detailed Description

The empty Signal. Implements the ISignal interface.

Abstract base class for Signals inheriting from ScriptableObject. Implements the ISignal interface.

Template Parameters
TThe type of the Value.

Member Function Documentation

◆ AddListener() [1/2]

void Signals.Signal< T >.AddListener ( UnityAction  listener)

Adds a listener.

Implements Signals.ISignal< T >.

◆ AddListener() [2/2]

void Signals.Signal< T >.AddListener ( UnityAction< T >  listener)

Adds a listener.

Implements Signals.ISignal< T >.

◆ OnEnable()

virtual void Signals.Signal< T >.OnEnable ( )
protectedvirtual

◆ operator T()

static implicit Signals.Signal< T >.operator T ( Signal< T >  signal)
static

Implicit cast from the Signal to it's Value.

Parameters
signalThe Signal.

◆ ProcessValue()

virtual void Signals.Signal< T >.ProcessValue ( ref T  value)
protectedvirtual

Override this method to preprocess values before applying them.

Parameters
valueThe value to process

◆ RemoveListener() [1/2]

void Signals.Signal< T >.RemoveListener ( UnityAction  listener)

Removes a listener.

Implements Signals.ISignal< T >.

◆ RemoveListener() [2/2]

void Signals.Signal< T >.RemoveListener ( UnityAction< T >  listener)

Removes a listener.

Implements Signals.ISignal< T >.

◆ TriggerUpdate() [1/2]

void Signals.Signal< T >.TriggerUpdate ( )

Invokes listeners.

Implements Signals.ISignal< T >.

◆ TriggerUpdate() [2/2]

void Signals.Signal< T >.TriggerUpdate ( )

Invokes listeners.

Implements Signals.ISignal< T >.

◆ ValidateValue()

virtual bool Signals.Signal< T >.ValidateValue ( in T  value)
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.

Parameters
valueThe new value.
Returns
Whether the Value shoud be updated.

Property Documentation

◆ InitialValue

T Signals.Signal< T >.InitialValue
getset

The initial value of the Signal.

◆ UseValidation

bool Signals.Signal< T >.UseValidation
getset

True if new values are validated, false otherwise.

◆ Value

T Signals.Signal< T >.Value
getset

The current value of the Signal. Setting the value invokes listeners.

Implements Signals.ISignal< T >.


The documentation for this class was generated from the following file: