StaticaddRegister a listener for eventName. Returns a dispose function — the primary teardown path. Multiple disposers (returned, once, signal.abort) are idempotent. Use EventSystemOptions for once and signal behavior.
StaticdispatchSynchronously fire eventName with the typed payload. Listeners are invoked in registration order; nested dispatches and self-disposing listeners are handled safely.
Synchronous, type-safe pub/sub for engine-wide events. Static-only — call as
EventSystem.addEventListener(...)/EventSystem.dispatchEvent(...). Event names and payloads are constrained by GameEventMap.Guarantees:
oncelisteners are removed before their callback runs, so nested dispatches and throwing callbacks can't double-fire them.eventName:message); siblings still receive the event.