Game Messages
Users of the Engine should not have to worry about issuing GameMessages, as it is an internal working, but if you want to extend the engine, maybe receiving (listening for) messages comes in handy.
To listen for a specific message type you can write:
MessageBus.Singleton.OfType<PickupCollideWithUnit>().Subscribe(OnPickupCollideWithUnit);
private static void OnPickupCollideWithUnit(PickupCollideWithUnit message){
}
csharp
Game Messages inheritance structure
This is (only) the "top" of the GameMessage inheritance hierarchy. All game messages inherit from GameMessage
.
Explanation:
ActorMessage
(and it’s inheritors) is meant to only be received by the Actor system and not for triggering any additional game logic.