Search Results for

    Show / Hide Table of Contents

    Class ObserverHub

    The hub class of the observer side in the publish-subscribe model.

    Inheritance
    System.Object
    Observer
    ObserverHub
    Namespace: black.kit.toybox
    Assembly: cs.temp.dll.dll
    Syntax
    public class ObserverHub : Observer
    Remarks

    Use this ObserverHub when you have many Observers registered in a Subject and it isn't easy to manage them. ObserverHub can be nested infinitely, but be careful of circular references.

    Usage (in the inspector of Unity Editor):

    1. Add this component or prefab to the scene.
    2. Tie this component to another identical component or a Subject component.
    3. Specify the children observers to notify.

    Methods

    OnNotify(Subject)

    The callback when a call is received from the subject.

    Declaration
    public override void OnNotify(Subject subject)
    Parameters
    Type Name Description
    Subject subject

    The subject that called the observer.

    Overrides
    Observer.OnNotify(Subject)

    See Also

    Observer
    Subject
    In This Article
    Back to top Example Unity documentation