Navigation
API > API/Plugins > API/Plugins/StateTreeModule
StateTree's delegates are used to send events through the state's hierarchy. Similar to events but more control. As a designer, you know exactly which delegate can be broadcast in the state tree asset. Delegates can be used in transitions (like events) and to trigger callbacks. They are primarily used in async tasks. Instead of ticking every frame (polling), you can register a delegate and wait for the callback to request a new transition. Delegates are designed to be bound in the editor (dispatcher and listener). By design, you cannot share delegates between state tree assets.
StateTree's delegates are composed of a sender (dispatcher) and a receiver (listener). The listener is linked to a simple callback at execution with FStateTreeExecutionContext.BindDelegate. You can only bind a listener to a dispatcher. (Cannot bind listener to listener or dispatcher to dispatcher).
See StateTreeDelegateTests.cpp for examples. StateTree's delegate dispatcher.
| Name | FStateTreeDelegateDispatcher |
| Type | struct |
| Header File | /Engine/Plugins/Runtime/StateTree/Source/StateTreeModule/Public/StateTreeDelegate.h |
| Include Path | #include "StateTreeDelegate.h" |
Syntax
USTRUCT (BlueprintType , Meta=(NoBinding))
struct FStateTreeDelegateDispatcher
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| ID | FGuid | StateTreeDelegate.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool IsValid() |
StateTreeDelegate.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool operator!=
(
const FStateTreeDelegateDispatcher& |
StateTreeDelegate.h | ||
bool operator==
(
const FStateTreeDelegateDispatcher& |
StateTreeDelegate.h |