Skip to content

ScriptableEventListener<TValue> Class

Base class for a component that listens to ScriptableEvent<T>.

C#
public abstract class ScriptableEventListener<TValue> : ScriptableListenerBase

TValue
The type to listen for.

Inheritance object → UnityEngine.Object → UnityEngine.Component → UnityEngine.Behaviour → UnityEngine.MonoBehaviour → ScriptableListenerBase

The event to listen to.

C#
public ScriptableEvent<TValue>? TargetEvent { get; set; }

When the listener should invoke its events.

C#
public EventInvokeEvents InvokeOn { get; set; }

What the argument needs to have been for the event to be invoked.

C#
public TValue? FromValue { get; set; }

What the argument needs to be for the event to be invoked.

C#
public TValue? ToValue { get; set; }

The event to invoke when the target event is raised.

C#
public UnityEvent<TValue> OnInvoked { get; }

Sets the listening state of the object.

C#
protected override sealed void SetListening(bool listen)

listen bool
If the object should listen to the target value.

Called before the event is invoked.

C#
protected virtual bool OnBeforeEventInvoked(object sender, TValue args)

sender object
The object that sent the event.

args TValue
The event arguments.

bool
true if the event should be invoked; otherwise, false.

Called after the event is invoked.

C#
protected virtual void OnAfterEventInvoked(object sender, TValue args)

sender object
The object that sent the event.

args TValue
The event arguments.