Navigation
API > API/Plugins > API/Plugins/StateTreeModule
StateTree struct ref allows to get a reference/pointer to a specified type via property binding. It is useful for referencing larger properties to avoid copies of the data, or to be able to write to a bounds property.
The expected type of the reference should be set in "BaseStruct" meta tag.
Example:
USTRUCT() struct FAwesomeTaskInstanceData {
FStateTreeStructRef Data; };
if (const FAwesomeData* Awesome = InstanceData.Data.GetPtr
| Name | FStateTreeStructRef |
| Type | struct |
| Header File | /Engine/Plugins/Runtime/StateTree/Source/StateTreeModule/Public/StateTreeTypes.h |
| Include Path | #include "StateTreeTypes.h" |
Syntax
USTRUCT (BlueprintType )
struct FStateTreeStructRef
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FStateTreeStructRef() |
StateTreeTypes.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool ExportTextItem
(
FString& ValueStr, |
StateTreeTypes.h | ||
const T & Get() |
Returns const reference to the struct, this getter assumes that all data is valid. | StateTreeTypes.h | |
T & GetMutable() |
Returns mutable reference to the struct, this getter assumes that all data is valid. | StateTreeTypes.h | |
T * GetMutablePtr() |
Returns mutable pointer to the struct, or nullptr if cast is not valid. | StateTreeTypes.h | |
const T * GetPtr() |
Returns const pointer to the struct, or nullptr if cast is not valid. | StateTreeTypes.h | |
const UScriptStruct * GetScriptStruct() |
StateTreeTypes.h | ||
bool IsValid() |
StateTreeTypes.h | ||
void Set
(
FStructView NewData |
Sets the struct ref (used by property copy) | StateTreeTypes.h |