Navigation
API > API/Plugins > API/Plugins/StateTreeModule
References
| Module | StateTreeModule |
| Header | /Engine/Plugins/Runtime/StateTree/Source/StateTreeModule/Public/StateTreeInstanceData.h |
| Include | #include "StateTreeInstanceData.h" |
Syntax
USTRUCT&40;&41;
struct FStateTreeInstanceStorage
Remarks
State Tree instance data is used to store the runtime state of a State Tree. It is used together with FStateTreeExecution context to tick the state tree. You are supposed to use FStateTreeInstanceData as a property to store the instance data. That ensures that any UObject references will get GC'd correctly.
The FStateTreeInstanceData wraps FStateTreeInstanceStorage, where the data is actually stored. This indirection is done in order to allow the FStateTreeInstanceData to be bitwise relocatable (e.g. you can put it in an array), and we can still allow delegates to bind to the instance data of individual tasks.
Since the tasks in the instance data are stored in a array that may get resized you will need to use TStateTreeInstanceDataStructRef to reference a struct based task instance data. It is defined below, and has example how to use it.Storage for the actual instance data.
Variables
| Type | Name | Description | |
|---|---|---|---|
| FStateTreeEventQueue | EventQueue | Events | |
| TArray< TObjectPtr< UObject > > | InstanceObjects | Object instances. | |
| FInstancedStructContainer | InstanceStructs | Struct instances | |
| TArray< FStateTreeTransitionRequest > | TransitionRequests | Requested transitions |
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | AddTransitionRequest
(
const UObject* Owner, |
Buffers a transition request to be sent to the State Tree. | |
| bool | |||
| const FStateTreeEventQueue & | |||
| FStateTreeEventQueue & | |||
| UObject * | GetMutableObject
(
const int32 Index |
||
| FStructView | GetMutableStruct
(
const int32 Index |
||
| const UObject * | GetObject
(
const int32 Index |
||
| FConstStructView | GetStruct
(
const int32 Index |
||
| TConstArrayView< FStateTreeTransitionRequest > | |||
| bool | IsValid () |
||
| bool | IsValidStructIndex
(
const int32 Index |
||
| int32 | NumObjects () |
||
| int32 | NumStructs () |
||
| void | Reset all pending transition requests. |