logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class SignalReactionComponent

    No-code counterpart to SignalEmitterComponent: reacts to a dispatched EventDispatcherSignal by invoking an inspector-authored UnityEngine.Events.UnityEvent.
    Where EventDispatcherAction<TSignal> is the code-defined reaction to a signal, this component lets a designer wire "when signal X is dispatched, do Y" entirely in the Inspector — pick the signal type from a dropdown and drag the response into a UnityEngine.Events.UnityEvent, with no C# required.

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

    Subscriptions are made through the shared IEventDispatcherService (resolved via ServiceLocatorBridge), so reactions go through the same path as code-defined actions. Because the service is registered during the initialization pipeline, this component waits (via a coroutine) until the service is available before binding, then unsubscribes cleanly when disabled or destroyed.

    The UnityEngine.Events.UnityEvent response is parameterless: it answers "react to this signal happening", not "read this signal's payload". Reactions that need the signal's data still belong in an EventDispatcherAction<TSignal>.

    Constructors

    SignalReactionComponent()

    Declaration
    public SignalReactionComponent()

    Properties

    Reactions

    Gets the configured signal-to-response mappings.

    Declaration
    public IReadOnlyList<SignalReactionComponent.SignalReaction> Reactions { get; }
    Property Value
    Type Description
    IReadOnlyList<SignalReactionComponent.SignalReaction>
    In this article
    © 2026 Serenity. All Rights Reserved