logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class SignalEmitterComponent

    Gameplay MonoBehaviour that dispatches Inspector-authored UnityEventDispatcherSignalDefinition assets through the IEventDispatcherService.
    Holds a list of signal definitions and exposes Dispatch(string), which builds and dispatches the definition whose Id matches the supplied id. Wire Dispatch(string) (or DispatchFirst()) to a collision, input callback, animation event or UnityEvent to emit a signal from a gameplay object.

    Inheritance
    object
    SignalEmitterComponent
    Namespace: Serenity.EventDispatcher.Infrastructure.Components
    Assembly: Serenity.UnityGlobal.Infrastructure.dll
    Syntax
    public class SignalEmitterComponent : MonoBehaviour

    Constructors

    SignalEmitterComponent()

    Declaration
    public SignalEmitterComponent()

    Properties

    SignalDefinitions

    Gets the signal definitions this emitter can dispatch.

    Declaration
    public IReadOnlyList<UnityEventDispatcherSignalDefinition> SignalDefinitions { get; }
    Property Value
    Type Description
    IReadOnlyList<UnityEventDispatcherSignalDefinition>

    Methods

    Dispatch(string)

    Builds and dispatches the signal whose definition Id matches id.
    No-ops (with a warning) when no definition matches the id, when the matched definition is null, or when the IEventDispatcherService is unavailable. Build/dispatch failures are logged and swallowed so a misconfigured asset cannot break the calling gameplay flow.

    Declaration
    public bool Dispatch(string id)
    Parameters
    Type Name Description
    string id

    The Id of the signal to dispatch.

    Returns
    Type Description
    bool

    true when a matching signal was dispatched; otherwise false.

    DispatchFirst()

    Builds and dispatches the first configured signal definition.
    Convenience for emitters that only carry a single signal, so the id does not have to be repeated.

    Declaration
    public bool DispatchFirst()
    Returns
    Type Description
    bool

    true when a signal was dispatched; otherwise false.

    In this article
    © 2026 Serenity. All Rights Reserved