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
TThe type of data this event carries.
- Inheritance
-
objectGameEventGeneric1<T>
- Implements
-
IRaisable<T>
- 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
contextTThe 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
listenerGameEventListenerGeneric1<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
listenerGameEventListenerGeneric1<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>