ScriptableEventListener<TValue> Class
Definition
Section titled “Definition”Base class for a component that listens to ScriptableEvent<T>.
public abstract class ScriptableEventListener<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”TargetEvent
Section titled “TargetEvent”The event to listen to.
public ScriptableEvent<TValue>? TargetEvent { get; set; }InvokeOn
Section titled “InvokeOn”When the listener should invoke its events.
public EventInvokeEvents InvokeOn { get; set; }FromValue
Section titled “FromValue”What the argument needs to have been for the event to be invoked.
public TValue? FromValue { get; set; }ToValue
Section titled “ToValue”What the argument needs to be for the event to be invoked.
public TValue? ToValue { get; set; }OnInvoked
Section titled “OnInvoked”The event to invoke when the target event is raised.
public UnityEvent<TValue> OnInvoked { 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.
OnBeforeEventInvoked(object, TValue)
Section titled “OnBeforeEventInvoked(object, TValue)”Called before the event is invoked.
protected virtual bool OnBeforeEventInvoked(object sender, TValue args)Parameters
Section titled “Parameters”sender object
The object that sent the event.
args TValue
The event arguments.
Returns
Section titled “Returns”bool
true if the event should be invoked; otherwise, false.
OnAfterEventInvoked(object, TValue)
Section titled “OnAfterEventInvoked(object, TValue)”Called after the event is invoked.
protected virtual void OnAfterEventInvoked(object sender, TValue args)Parameters
Section titled “Parameters”sender object
The object that sent the event.
args TValue
The event arguments.