ScriptableValueListener<TValue> Class
Definition
Section titled “Definition”Base class for a component that listens to ScriptableValue<T>.
public abstract class ScriptableValueListener<TValue> : ScriptableListenerBaseType Parameters
Section titled “Type Parameters”TValue
The type to listen for.
Inheritance object → UnityEngine.Object → UnityEngine.Component → UnityEngine.Behaviour → UnityEngine.MonoBehaviour → ScriptableListenerBase
Properties
Section titled “Properties”TargetValue
Section titled “TargetValue”The value to listen to.
public ScriptableValue<TValue>? TargetValue { get; set; }InvokeOn
Section titled “InvokeOn”When listeners should invoke their events.
public InvokeEvents InvokeOn { get; set; }FromValue
Section titled “FromValue”What the old value needs to be for the event to be invoked.
public TValue? FromValue { get; set; }ToValue
Section titled “ToValue”What the new value needs to be for the event to be invoked.
public TValue? ToValue { get; set; }InvokeParameters
Section titled “InvokeParameters”How many parameters listeners should use when invoking their events.
public InvokeParameters InvokeParameters { get; set; }OnValueChangingSingle
Section titled “OnValueChangingSingle”The event to invoke when the value is changing.
public UnityEvent<TValue> OnValueChangingSingle { get; }OnValueChangedSingle
Section titled “OnValueChangedSingle”The event to invoke when the value has changed.
public UnityEvent<TValue> OnValueChangedSingle { get; }OnValueChangingMultiple
Section titled “OnValueChangingMultiple”The event to invoke when the value is changing.
public UnityEvent<TValue, TValue> OnValueChangingMultiple { get; }OnValueChangedMultiple
Section titled “OnValueChangedMultiple”The event to invoke when the value has changed.
public UnityEvent<TValue, TValue> OnValueChangedMultiple { get; }Methods
Section titled “Methods”SetListening(bool)
Section titled “SetListening(bool)”Sets the listening state of the object.
protected override sealed void SetListening(bool listen)Parameters
Section titled “Parameters”listen bool
If the object should listen to the target value.
OnBeforeValueChangingInvoked(TValue, TValue)
Section titled “OnBeforeValueChangingInvoked(TValue, TValue)”Called before the value changing event.
protected virtual bool OnBeforeValueChangingInvoked(TValue oldValue, TValue newValue)Parameters
Section titled “Parameters”oldValue TValue
The current value.
newValue TValue
The new value being set.
Returns
Section titled “Returns”bool
true if the event should be invoked; otherwise, false.
OnAfterValueChangingInvoked(TValue, TValue)
Section titled “OnAfterValueChangingInvoked(TValue, TValue)”Called after the value changing event.
protected virtual void OnAfterValueChangingInvoked(TValue oldValue, TValue newValue)Parameters
Section titled “Parameters”oldValue TValue
The previous value.
newValue TValue
The new value that was set.
OnBeforeValueChangedInvoked(TValue, TValue)
Section titled “OnBeforeValueChangedInvoked(TValue, TValue)”Called before the value changed event.
protected virtual bool OnBeforeValueChangedInvoked(TValue oldValue, TValue newValue)Parameters
Section titled “Parameters”oldValue TValue
The current value.
newValue TValue
The new value being set.
Returns
Section titled “Returns”bool
true if the event should be invoked; otherwise, false.
OnAfterValueChangedInvoked(TValue, TValue)
Section titled “OnAfterValueChangedInvoked(TValue, TValue)”Called after the value changed event.
protected virtual void OnAfterValueChangedInvoked(TValue oldValue, TValue newValue)Parameters
Section titled “Parameters”oldValue TValue
The previous value.
newValue TValue
The new value that was set.