Defining System Events
System events are plain Go structs that implement theSystemEvent interface. This interface requires a single Name() method that returns a unique string identifier:
Using System Events
Just like with components and commands, you must register a system event type with the world beforeStartGame:
Emitting System Events
Usew.EmitSystemEvent to send a system event:
Emitting or receiving a system event type that was not registered panics.
Receiving System Events
Usew.SystemEvents[T]() to loop through all system events of type T emitted so far this tick:
Different systems can receive the same system event type.