Table of Contents

Class GameEventGeneric1<T>

Namespace
ElectricDrill.SoapRpgFramework.Events
Assembly
com.electricdrill.soap-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> : ScriptableObject, IRaisable<T>

Type Parameters

T

The type of data this event carries.

Inheritance
object
GameEventGeneric1<T>
Implements
Derived

Methods

Raise(T)

Raises the event with the specified context, notifying all registered listeners. Both MonoBehaviour listeners and Action listeners are notified.

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>