A complete projectile game — player fires, enemies spawn, power-ups drop. This example reveals how EGTK handles spawnable objects: game logic lives on persistent scene GameObjects, while spawned prefabs are just tagged colliders.
EGTK games that spawn objects use two kinds of GameObjects with very different responsibilities. Understanding the split is the key to making this pattern work.
The player (ProjectileSpawner) carries an InputTriggerZone for each tag it cares about. When an enemy wanders into that zone, the zone fires — and the player's wired event calls the manager. The enemy itself doesn't need to know about any manager.
This is the most important thing to understand about EGTK and Unity prefabs. A UnityEvent that points to a scene object — a manager, a door, another player — cannot be saved inside a prefab. The prefab doesn't know which scene it will land in.
m_Target: {fileID: 0} — a null.
The method name is remembered, but the target is gone. At runtime,
the event fires and silently does nothing.
When you need scene-wired events on an object that appears many times — different enemy types, collectibles with different sounds — don't make a prefab. Configure the first one in the scene, then duplicate it (Ctrl+D). The duplicated object keeps all its wired events intact.
GameHealthManager, set the method, set the value.
Test that it works.
Ctrl+D.
The copy has all the same component settings and event wiring —
it's a snapshot of the configured state, not a blank prefab instance.
Reposition and rename as needed.
GameHealthManager wiring.
This is faster than rebuilding from a blank prefab every time.
All the connections, in order of what fires what.