Choose your operating system:
Windows
macOS
Linux
Module |
|
Header |
/Engine/Source/Runtime/Messaging/Public/IMessageBus.h |
Include |
#include "IMessageBus.h" |
TSharedPtr< IMessageSubscription, ESPMode::ThreadSafe > Subscribe
(
const TSharedRef< IMessageReceiver, ESPMode::ThreadSafe > & Subscriber,
const FName & MessageType,
const TRange< EMessageScope > & ScopeRange
)
Adds a subscription for published messages of the specified type.
Subscriptions allow message consumers to receive published messages from the message bus. The returned interface can be used to query the subscription's details and its enabled state.
The added subscription, or nullptr if the subscription failed.
Parameter |
Description |
---|---|
Subscriber |
The subscriber wishing to receive the messages. |
MessageType |
The type of messages to subscribe to (NAME_All = subscribe to all message types). |
ScopeRange |
The range of message scopes to include in the subscription. |