NotificationCenter Class
Public Member Functions | |
| bool | HandlerSetHasObserver (NotificationHandler handler, string notificationName) |
| Determines if a specific handler has already been registered to a notification. More... | |
| void | AddObserver (NotificationHandler handler, string notificationName) |
| Registers a handler to a notification. More... | |
| void | RemoveObserver (NotificationHandler handler, string notificationName) |
| Unregisters a handler from a notification. More... | |
| void | GetStringAndArgFromJson (string message, out string name, out string arg) |
| Gets the string and argument values from the message json payload of format: {"name": "name_val", "arg": {"arg_json_val"}. More... | |
Properties | |
| static NotificationCenter | Instance [get] |
Member Function Documentation
◆ AddObserver()
| inline |
Registers a handler to a notification.
- Parameters
handler The function that will be triggered when the notification arrives. notificationName The name of the notification to listen for.
◆ GetStringAndArgFromJson()
| inline |
Gets the string and argument values from the message json payload of format: {"name": "name_val", "arg": {"arg_json_val"}.
- Parameters
message Message. name Name. arg Argument.
◆ HandlerSetHasObserver()
| inline |
Determines if a specific handler has already been registered to a notification.
- Parameters
handler The function that was registered to be triggered when the notification arrived. notificationName The name of the notification to listen for.
- Returns
trueIf the handler is already registered,falseotherwise.
◆ RemoveObserver()
| inline |
Unregisters a handler from a notification.
- Parameters
handler The function that was registered to be triggered when the notification arrived. notificationName The name of the notification to listen for.