Register and Remove Event Flows at Runtime
A generated room can connect its pressure plate to a trap only after the layout is known. Register the connection after creating the room, store the returned handle on the room owner, and remove the connection when that room is discarded.
Register Trigger branches
Use Trigger connections when one event should start several independent responses. When a door opens, turn on the lights and disable the alarm. All three fields in this example are parameterless GameEvent assets.
TriggerHandle lights = onDoorOpened.AddTriggerEvent(
onLightsOn,
delay: 0.5f,
condition: () => isNight);
TriggerHandle alarm = onDoorOpened.AddTriggerEvent(
onAlarmDisabled,
priority: 10);
GES checks each condition when the source dispatches. Higher-priority Trigger connections are visited first. A zero-delay target raises immediately, while a delayed target runs when its delay expires. The connections in the graph below each respond to the source independently.

Typed events can forward or transform their argument. Here onPlayerHit is an Int32GameEvent and onDamageScale is a SingleGameEvent, which receives a float.
TriggerHandle scale = onPlayerHit.AddTriggerEvent(
onDamageScale,
condition: amount => amount > 0,
passArgument: true,
argumentTransformer: amount => amount / 100f);
Keep each handle with its source. To remove these connections, pass each handle back to the event that registered it.
onDoorOpened.RemoveTriggerEvent(lights);
onDoorOpened.RemoveTriggerEvent(alarm);
onPlayerHit.RemoveTriggerEvent(scale);
Register a Chain on one source
A Chain runs the steps registered on one source in registration order. In this example all three events are parameterless GameEvent assets. When onBossPhaseStart fires, the first step raises the animation event and holds the chain for three seconds. The next step waits another half second, then raises the spawn event.
ChainHandle animation = onBossPhaseStart.AddChainEvent(
onPlayBossAnimation,
duration: 3f);
ChainHandle spawn = onBossPhaseStart.AddChainEvent(
onSpawnAdds,
delay: 0.5f);
A step's delay runs before its target raises. Its duration runs after the raise. A false condition stops the remaining steps in that chain. waitForCompletion: true adds a one-frame wait after the step. To time spawning to actual animation completion, raise a separate event from an animation callback and use it as the source.

Register the steps on the same source so they share one sequence. Remove them with onBossPhaseStart.RemoveChainEvent(animation) and onBossPhaseStart.RemoveChainEvent(spawn) when the owning phase ends.
Wire a generated room and remove its connections
Assign a room its own entry event. Attach a Trigger for the lights and a Chain for the room's ready signal. This component owns both registrations and removes them when the room is disabled.
using TinyGiants.GES.Runtime;
using UnityEngine;
public sealed class DungeonRoomEvents : MonoBehaviour
{
[GameEventDropdown, SerializeField] private GameEvent onRoomEntered;
[GameEventDropdown, SerializeField] private GameEvent onLightsOn;
[GameEventDropdown, SerializeField] private GameEvent onRoomReady;
[SerializeField] private bool isCleared;
private TriggerHandle _lights;
private ChainHandle _ready;
private void OnEnable()
{
_lights = onRoomEntered.AddTriggerEvent(
onLightsOn, condition: () => !isCleared);
_ready = onRoomEntered.AddChainEvent(
onRoomReady, delay: 2f, condition: () => !isCleared);
}
public void EnterRoom() => onRoomEntered.Raise();
private void OnDisable()
{
onRoomEntered.RemoveTriggerEvent(_lights);
onRoomEntered.RemoveChainEvent(_ready);
_lights = null;
_ready = null;
}
}
The room owns its cleared state. Keep conditions short and read that state directly. Removing a handle updates future dispatches. A delayed Trigger or running Chain may already have captured its work, so a delayed response that depends on the room should check that the room is still active before applying changes.
In Play Mode, raise the entry event and open Automation in Game Event Monitor to inspect the Trigger and Chain connections.

🚀 Global Developer Service Matrix
🇨🇳 China Developer Community
- 🛒 Unity China Asset Store
- 🎥 Bilibili Video Tutorials
- 📘 Technical Documentation
- 💬 QQ Group (1071507578)
🌐 Global Developer Community
📧 Support & Collaboration
