Add Observer (Event)
- C++
- Blueprint
UFUNCTION(
BlueprintCallable,
Meta = (DisplayName = "Add Observer (Event)", DefaultToSelf = "Observer", AutoCreateRefTerm = "EventClass"),
Category = "Event System")
FLES_ObserverHandle BP_AddObserver_Event(
UPARAM(Meta = (AllowAbstract = "false")) const TSubclassOf<ULES_Event>& EventClass, UObject* Observer,
FLES_EventHandler Callback, const FName Channel = NAME_None);
Parameters | |
---|---|
EventClass | The static class of the events the Observer should listen for. |
Observer | The object that will be notified when events of EventClass type are sent on the Channel. |
Callback | The event handler that will be called when the event is received. |
Channel | Determines the channel the event will be sent on. Observers are notified only about the events sent on the channel they're listening on. |
Return | A handle to the newly created observer record in the Event System. You may use this handle later to remove this particular observer record from the Event System. |
Adds the Observer to the Event System and marks it as listening for events of EventClass type, that are sent on the specified Channel. The Callback will not be called if an Event is sent and the Observer has already been garbage-collected.
Example usage: