Table of Contents

Class GameEventGeneric1<T>

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

A generic ScriptableObject-based event system that can carry one parameter of type T. Supports both MonoBehaviour-based listeners and code-based Action listeners.

public abstract class GameEventGeneric1<T> : GameEventBase<GameEventListenerGeneric1<T>, Action<T>>, IRaisable<T>

Type Parameters

T

The type of data this event carries.

Inheritance
object
GameEventGeneric1<T>
Implements
Derived
Inherited Members

Methods

Raise(T)

Raises the event with the specified context, notifying all registered listeners. Both MonoBehaviour listeners and Action listeners are notified in registration order. Listeners are snapshot before iteration so that subscribe/unsubscribe during a callback does not affect the current raise. The non-reentrant path is allocation-free after warmup.

public virtual void Raise(T context)

Parameters

context T

The data to pass to all listeners.

RegisterListener(GameEventListenerGeneric1<T>)

Registers a MonoBehaviour-based listener to be notified when this event is raised. Duplicate listeners are automatically prevented.

public void RegisterListener(GameEventListenerGeneric1<T> listener)

Parameters

listener GameEventListenerGeneric1<T>

The GameEventListenerGeneric1 to register.

UnregisterListener(GameEventListenerGeneric1<T>)

Unregisters a MonoBehaviour-based listener so it will no longer be notified when this event is raised.

public void UnregisterListener(GameEventListenerGeneric1<T> listener)

Parameters

listener GameEventListenerGeneric1<T>

The GameEventListenerGeneric1 to unregister.

Events

OnEventRaised

Event that can be subscribed to from code using standard C# event syntax. Automatically handles registration and unregistration of Action listeners.

public virtual event Action<T> OnEventRaised

Event Type

Action<T>