Class ObserverHub
The hub class of the observer side in the publish-subscribe model.
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):
- Add this component or prefab to the scene.
- Tie this component to another identical component or a Subject component.
- 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. |