Skip to content

LifecycleEventRelay

Broadcasts MonoBehaviour lifecycle callbacks (Awake, Start, OnEnable, OnDisable, OnDestroy) as subscribable events.

Namespace: Jungle.Events
Inherits: MonoBehaviour

Overview

Add LifecycleEventRelay to any GameObject that needs to be monitored by event-driven systems. It exposes C# events for each lifecycle phase. Late subscribers to Awake or Start receive an immediate callback if that phase already fired.

Events

Event Description
Awoke Fired during Awake.
Started Fired during Start.
Enabled Fired during OnEnable.
Disabled Fired during OnDisable.
Destroyed Fired during OnDestroy.

Methods

Method Description
Register(MonoBehaviourCallback, Action) Subscribe to a lifecycle phase. Fires immediately if the phase already occurred (Awake, Start) or the object is currently active (OnEnable).
Unregister(MonoBehaviourCallback, Action) Unsubscribe from a lifecycle phase.

See Also