Table of Contents

Class GameEventListenerGeneric1<T>

Namespace
ElectricDrill.AstraRpgFramework.Events
Assembly
com.electricdrill.astra-rpg-framework.Runtime.dll

MonoBehaviour component that listens to GameEventGeneric1 objects and responds with UnityEvents. Automatically registers and unregisters itself when enabled/disabled.

public class GameEventListenerGeneric1<T> : MonoBehaviour

Type Parameters

T

The type of parameter the listened event carries.

Inheritance
object
GameEventListenerGeneric1<T>
Derived
Extension Methods

Fields

_event

[SerializeField]
protected GameEventGeneric1<T> _event

Field Value

GameEventGeneric1<T>

_ownerAwareGameActions

[SerializeField]
[Tooltip("Game Actions executed with this listener as runtime owner. Conditions on these actions will resolve Holder to the EntityCore on this listener's GameObject. Any GameAction whose context type is compatible with this event's payload type will be dispatched.")]
protected List<GameActionBase> _ownerAwareGameActions

Field Value

List<GameActionBase>

_response

[SerializeField]
protected UnityEvent<T> _response

Field Value

UnityEvent<T>

Methods

OnEventRaised(T)

Called by the GameEvent when it is raised. Invokes the configured UnityEvent response, then executes owner-aware actions with this listener as the runtime owner.

public void OnEventRaised(T context)

Parameters

context T

The data passed from the event.