Table of Contents

Class GameEvent

Namespace
ElectricDrill.SoapRpgFramework.Events
Assembly
com.electricdrill.soap-rpg-framework.Runtime.dll

A ScriptableObject-based event system that allows decoupled communication between game systems. GameEvents can be raised to notify all registered listeners without requiring direct references.

[CreateAssetMenu(fileName = "New Game Event", menuName = "Soap RPG Framework/Events/Game Event")]
public class GameEvent : ScriptableObject
Inheritance
object
GameEvent

Methods

Raise()

Raises the event, notifying all registered listeners. Listeners are processed in reverse order to handle potential modifications during iteration.

public void Raise()

RegisterListener(GameEventListener)

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

public void RegisterListener(GameEventListener listener)

Parameters

listener GameEventListener

The GameEventListener to register.

UnregisterListener(GameEventListener)

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

public void UnregisterListener(GameEventListener listener)

Parameters

listener GameEventListener

The GameEventListener to unregister.