Class ActorSpeedMessageRelay
Listens for ActorSpeedMessage events via the IEventAggregator and relays them through a UnityEvent. This allows connecting to UI components or other systems in the Inspector.
public class ActorSpeedMessageRelay : MessageRelay<ActorSpeedMessage>, IHandle<ActorSpeedMessage>
Inheritance
object→Object→Component→Behaviour→MonoBehaviour→MessageRelay<ActorSpeedMessage>→ActorSpeedMessageRelayImplements
Inherited Members
- MessageRelay<ActorSpeedMessage>.m_ChannelKey
- MessageRelay<ActorSpeedMessage>.OnEnable()
- MessageRelay<ActorSpeedMessage>.OnDisable()
- MessageRelay<ActorSpeedMessage>.Handle(ActorSpeedMessage)
Fields
OnSpeedReceived
UnityEvent(s) invoked when a ActorSpeedMessage is received.
[SerializeField]
[Tooltip("Invoked when a message is received.")]
protected UnityEvent<float> OnSpeedReceived
Field Value
UnityEvent<float>
Methods
Handle(ActorSpeedMessage)
Receives the ActorSpeedMessage from the aggregator and converts it into the appropriate UnityEvent invocation.
public override void Handle(ActorSpeedMessage message)
Parameters
| Name | Type | Description |
|---|---|---|
message | ActorSpeedMessage | The message payload delivered by the aggregator. |
Remarks
Subclasses extract the relevant fields from message and pass them to
their declared UnityEvent. For example, a battery relay would call
OnBatteryLevelChanged?.Invoke(msg.level).