Skip to content

LocalSignalTransmitter

Per-GameObject pub/sub for signals.

Namespace: Jungle.Events Inherits: MonoBehaviour

Overview

LocalSignalTransmitter is a per-instance routing scope for SignalType keys. Anything with a reference to this transmitter can register listeners against a signal, raise that signal, or unregister. Each transmitter is its own scope — two instances of the same prefab don't share listeners, which is the gap a shared signal asset can't close on its own.

Sibling to Reactor: a Reactor consumes signals through its Receive method into typed reactive entries. A transmitter exposes the same routing fabric to processes and operations that want to wait on or raise a signal without going through a reactor.

Common usage patterns:

  • Drop a SignalEventFromHub into any IEvent slot (e.g. the completion event of a wait-for-event process) to subscribe locally rather than through a shared asset.
  • Drop a RaiseSignalOnTransmitterOperation into any operation list to fan out a signal locally.
  • Use RaiseSignalOnOwnerTransmitterOperation for the common "broadcast on this object's transmitter" case — it finds the transmitter by GameObject reference.

Methods

Method Description
Register(SignalType, Action) Subscribes a handler to a signal on this transmitter.
Unregister(SignalType, Action) Removes a previously-registered handler.
Raise(SignalType) Invokes every handler registered for the signal.

See Also