docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class SignalReceiver

    Listens for emitted signals and reacts depending on its defined reactions.

    Inheritance
    object
    Object
    Component
    Behaviour
    MonoBehaviour
    SignalReceiver
    Implements
    INotificationReceiver
    Inherited Members
    MonoBehaviour.IsInvoking()
    MonoBehaviour.CancelInvoke()
    MonoBehaviour.Invoke(string, float)
    MonoBehaviour.InvokeRepeating(string, float, float)
    MonoBehaviour.CancelInvoke(string)
    MonoBehaviour.IsInvoking(string)
    MonoBehaviour.StartCoroutine(string)
    MonoBehaviour.StartCoroutine(string, object)
    MonoBehaviour.StartCoroutine(IEnumerator)
    MonoBehaviour.StartCoroutine_Auto(IEnumerator)
    MonoBehaviour.StopCoroutine(IEnumerator)
    MonoBehaviour.StopCoroutine(Coroutine)
    MonoBehaviour.StopCoroutine(string)
    MonoBehaviour.StopAllCoroutines()
    MonoBehaviour.print(object)
    MonoBehaviour.useGUILayout
    MonoBehaviour.runInEditMode
    Behaviour.enabled
    Behaviour.isActiveAndEnabled
    Component.GetComponent(Type)
    Component.GetComponent<T>()
    Component.TryGetComponent(Type, out Component)
    Component.TryGetComponent<T>(out T)
    Component.GetComponent(string)
    Component.GetComponentInChildren(Type, bool)
    Component.GetComponentInChildren(Type)
    Component.GetComponentInChildren<T>(bool)
    Component.GetComponentInChildren<T>()
    Component.GetComponentsInChildren(Type, bool)
    Component.GetComponentsInChildren(Type)
    Component.GetComponentsInChildren<T>(bool)
    Component.GetComponentsInChildren<T>(bool, List<T>)
    Component.GetComponentsInChildren<T>()
    Component.GetComponentsInChildren<T>(List<T>)
    Component.GetComponentInParent(Type, bool)
    Component.GetComponentInParent(Type)
    Component.GetComponentInParent<T>(bool)
    Component.GetComponentInParent<T>()
    Component.GetComponentsInParent(Type, bool)
    Component.GetComponentsInParent(Type)
    Component.GetComponentsInParent<T>(bool)
    Component.GetComponentsInParent<T>(bool, List<T>)
    Component.GetComponentsInParent<T>()
    Component.GetComponents(Type)
    Component.GetComponents(Type, List<Component>)
    Component.GetComponents<T>(List<T>)
    Component.GetComponents<T>()
    Component.CompareTag(string)
    Component.SendMessageUpwards(string, object, SendMessageOptions)
    Component.SendMessageUpwards(string, object)
    Component.SendMessageUpwards(string)
    Component.SendMessageUpwards(string, SendMessageOptions)
    Component.SendMessage(string, object)
    Component.SendMessage(string)
    Component.SendMessage(string, object, SendMessageOptions)
    Component.SendMessage(string, SendMessageOptions)
    Component.BroadcastMessage(string, object, SendMessageOptions)
    Component.BroadcastMessage(string, object)
    Component.BroadcastMessage(string)
    Component.BroadcastMessage(string, SendMessageOptions)
    Component.transform
    Component.gameObject
    Component.tag
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(object)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, bool)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, bool)
    Object.Destroy(Object, float)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, bool)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.FindObjectsOfType(Type, bool)
    Object.FindObjectsByType(Type, FindObjectsSortMode)
    Object.FindObjectsByType(Type, FindObjectsInactive, FindObjectsSortMode)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, float)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectsByType<T>(FindObjectsSortMode)
    Object.FindObjectsOfType<T>(bool)
    Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
    Object.FindObjectOfType<T>()
    Object.FindObjectOfType<T>(bool)
    Object.FindFirstObjectByType<T>()
    Object.FindAnyObjectByType<T>()
    Object.FindFirstObjectByType<T>(FindObjectsInactive)
    Object.FindAnyObjectByType<T>(FindObjectsInactive)
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.FindFirstObjectByType(Type)
    Object.FindAnyObjectByType(Type)
    Object.FindObjectOfType(Type, bool)
    Object.FindFirstObjectByType(Type, FindObjectsInactive)
    Object.FindAnyObjectByType(Type, FindObjectsInactive)
    Object.ToString()
    Object.name
    Object.hideFlags
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.Timeline
    Assembly: Unity.Timeline.dll
    Syntax
    public class SignalReceiver : MonoBehaviour, INotificationReceiver
    Remarks

    A SignalReceiver contains a list of reactions. Each reaction is bound to a SignalAsset. When a SignalEmitter emits a signal, the SignalReceiver invokes the corresponding reaction.

    Methods

    AddEmptyReaction(UnityEvent)

    Appends a null SignalAsset with a reaction specified by the UnityEvent.

    Declaration
    public int AddEmptyReaction(UnityEvent reaction)
    Parameters
    Type Name Description
    UnityEvent reaction

    The new reaction to be appended.

    Returns
    Type Description
    int

    The index of the appended reaction.

    Remarks

    Multiple null assets are valid.

    See Also
    SignalEmitter
    SignalAsset

    AddReaction(SignalAsset, UnityEvent)

    Defines a new reaction for a SignalAsset.

    Declaration
    public void AddReaction(SignalAsset asset, UnityEvent reaction)
    Parameters
    Type Name Description
    SignalAsset asset

    The SignalAsset for which the reaction is being defined.

    UnityEvent reaction

    The UnityEvent that describes the reaction.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown when the asset is null.

    ArgumentException

    Thrown when the SignalAsset is already registered with this receiver.

    See Also
    SignalEmitter
    SignalAsset

    ChangeReactionAtIndex(int, UnityEvent)

    Replaces the reaction at a specific index with a new UnityEvent.

    Declaration
    public void ChangeReactionAtIndex(int idx, UnityEvent reaction)
    Parameters
    Type Name Description
    int idx

    The index of the reaction to be replaced.

    UnityEvent reaction

    The replacement reaction.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown when the replacement reaction is null.

    See Also
    SignalEmitter
    SignalAsset

    ChangeSignalAtIndex(int, SignalAsset)

    Replaces the SignalAsset associated with a reaction at a specific index.

    Declaration
    public void ChangeSignalAtIndex(int idx, SignalAsset newKey)
    Parameters
    Type Name Description
    int idx

    The index of the reaction.

    SignalAsset newKey

    The replacement SignalAsset.

    Remarks

    The new SignalAsset can be null.

    Exceptions
    Type Condition
    ArgumentException

    Thrown when the replacement SignalAsset is already registered to this SignalReceiver.

    See Also
    SignalEmitter
    SignalAsset

    Count()

    Returns the count of registered SignalAssets.

    Declaration
    public int Count()
    Returns
    Type Description
    int

    The count of registered SignalAssets

    See Also
    SignalEmitter
    SignalAsset

    GetReaction(SignalAsset)

    Gets the first UnityEvent associated with a SignalAsset.

    Declaration
    public UnityEvent GetReaction(SignalAsset key)
    Parameters
    Type Name Description
    SignalAsset key

    A SignalAsset defining the signal.

    Returns
    Type Description
    UnityEvent

    Returns the reaction associated with a SignalAsset. Returns null if the signal asset does not exist.

    See Also
    SignalEmitter
    SignalAsset

    GetReactionAtIndex(int)

    Gets the reaction at a specific index.

    Declaration
    public UnityEvent GetReactionAtIndex(int idx)
    Parameters
    Type Name Description
    int idx

    The index of the reaction.

    Returns
    Type Description
    UnityEvent

    Returns a reaction.

    See Also
    SignalEmitter
    SignalAsset

    GetRegisteredSignals()

    Gets a list of all registered SignalAssets.

    Declaration
    public IEnumerable<SignalAsset> GetRegisteredSignals()
    Returns
    Type Description
    IEnumerable<SignalAsset>

    Returns a list of SignalAssets.

    See Also
    SignalEmitter
    SignalAsset

    GetSignalAssetAtIndex(int)

    Gets the SignalAsset at a specific index

    Declaration
    public SignalAsset GetSignalAssetAtIndex(int idx)
    Parameters
    Type Name Description
    int idx

    The index of the SignalAsset.

    Returns
    Type Description
    SignalAsset

    Returns a SignalAsset.

    See Also
    SignalEmitter
    SignalAsset

    OnNotify(Playable, INotification, object)

    Called when a notification is sent.

    Declaration
    public void OnNotify(Playable origin, INotification notification, object context)
    Parameters
    Type Name Description
    Playable origin

    The playable that sent the notification.

    INotification notification

    The received notification. Only notifications of type SignalEmitter will be processed.

    object context

    User defined data that depends on the type of notification. Uses this to pass necessary information that can change with each invocation.

    See Also
    SignalEmitter
    SignalAsset

    Remove(SignalAsset)

    Removes the first occurrence of a SignalAsset.

    Declaration
    public void Remove(SignalAsset asset)
    Parameters
    Type Name Description
    SignalAsset asset

    The SignalAsset to be removed.

    See Also
    SignalEmitter
    SignalAsset

    RemoveAtIndex(int)

    Removes the SignalAsset and reaction at a specific index.

    Declaration
    public void RemoveAtIndex(int idx)
    Parameters
    Type Name Description
    int idx

    The index of the SignalAsset to be removed.

    See Also
    SignalEmitter
    SignalAsset

    Implements

    INotificationReceiver

    See Also

    SignalEmitter
    SignalAsset
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)