Navigation
API > API/Plugins > API/Plugins/StateTreeModule
StateTree asset. Contains the StateTree definition in both editor and runtime (baked) formats.
| Name | UStateTree |
| Type | class |
| Header File | /Engine/Plugins/Runtime/StateTree/Source/StateTreeModule/Public/StateTree.h |
| Include Path | #include "StateTree.h" |
Syntax
UCLASS (MinimalAPI, BlueprintType)
class UStateTree : public UDataAsset
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UDataAsset → UStateTree
Derived Classes
Structs
| Name | Remarks |
|---|---|
| FDebugInstanceData |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FMemoryRequirement | UE::StateTree::InstanceData::FEvaluationScopeInstanceContainer::FMemoryRequirement | StateTree.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| EditorData | TObjectPtr< UObject > | Edit time data for the StateTree, instance of UStateTreeEditorData | StateTree.h | |
| LastCompiledEditorDataHash | uint32 | Hash of the editor data from last compile. | StateTree.h | |
| OnObjectsReinstancedHandle | FDelegateHandle | StateTree.h | ||
| OnPreBeginPIEHandle | FDelegateHandle | StateTree.h | ||
| OnUserDefinedStructReinstancedHandle | FDelegateHandle | StateTree.h |
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bCachedRequestGlobalTick | uint8 | True if any global tasks request a tick every frame. | StateTree.h | |
| bCachedRequestGlobalTickOnlyOnEvents | uint8 | True if any global tasks request a tick every frame but only if there are events. | StateTree.h | |
| bHasGlobalTickTasks | uint8 | True if any global task has bShouldCallTick. Not ticking implies no property copy. | StateTree.h | |
| bHasGlobalTickTasksOnlyOnEvents | uint8 | True if any global task has bShouldCallTickOnlyOnEvents. | StateTree.h | |
| bHasGlobalTransitionTasks | uint8 | True if any global task is a transition task. | StateTree.h | |
| bIsLinked | uint8 | True if the StateTree was linked successfully. | StateTree.h | |
| bScheduledTickAllowed | uint8 | True when the scheduled tick is allowed by the schema. | StateTree.h | |
| CompletionGlobalTasksControl | EStateTreeTaskCompletionType | How the global tasks control the completion of the frame. | StateTree.h | |
| CompletionGlobalTasksMask | uint32 | Mask used to test the global tasks completion. | StateTree.h | |
| ContextDataDescs | TArray< FStateTreeExternalDataDesc > | List of names external data enforced by the schema, created at compilation. | StateTree.h | |
| DefaultEvaluationScopeInstanceData | UE::StateTree::InstanceData::FInstanceContainer | Default node instance data for evaluation scope (e.g. conditions, considerations, functions) | StateTree.h | |
| DefaultExecutionRuntimeData | UE::StateTree::InstanceData::FInstanceContainer | Default node execution runtime data for execution runtime (e.g. tasks, conditions, considerations, functions) | StateTree.h | |
| DefaultInstanceData | FStateTreeInstanceData | Default node instance data (e.g. evaluators, tasks). | StateTree.h | |
| EvaluatorsBegin | uint16 | Index of first evaluator in Nodes. | StateTree.h | |
| EvaluatorsNum | uint16 | Number of evaluators. | StateTree.h | |
| Extensions | TArray< TObjectPtr< UStateTreeExtension > > | The asset extensions. A place to add extra information for plugins. | StateTree.h | |
| ExternalDataDescs | TArray< FStateTreeExternalDataDesc > | List of external data required by the state tree, created during linking. | StateTree.h |
|
| Frames | TArray< FCompactStateTreeFrame > | Runtime frames | StateTree.h | |
| GCObjectDatas | TArray< FDebugInstanceData > | StateTree.h | ||
| GlobalTasksBegin | uint16 | Index of first global task in Nodes. | StateTree.h | |
| GlobalTasksNum | uint16 | Number of global tasks. | StateTree.h | |
| IDToNodeMappings | TArray< FStateTreeNodeIdToIndex > | Mapping of node guid for the Editor and node index, created at compilation. | StateTree.h | |
| IDToStateMappings | TArray< FStateTreeStateIdToHandle > | Mapping of state guid for the Editor and state handles, created at compilation. | StateTree.h | |
| IDToTransitionMappings | TArray< FStateTreeTransitionIdToIndex > | Mapping of state transition identifiers and runtime compact transition index, created at compilation. | StateTree.h | |
| Nodes | FInstancedStructContainer | Evaluators, Tasks, Condition and Consideration nodes. | StateTree.h | |
| NumContextData | uint16 | Number of context data, include parameters and all context data. | StateTree.h | |
| NumGlobalInstanceData | uint16 | Number of global instance data. | StateTree.h | |
| OutOfDateStructs | TSet< FObjectKey > | List of Struct that are out of date and waiting to be replaced with the new instance. | StateTree.h | |
| ParameterDataType | EStateTreeParameterDataType | The parameter data type used by the schema. | StateTree.h | |
| Parameters | FInstancedPropertyBag | Parameters that could be used for bindings within the Tree. | StateTree.h | |
| PerThreadSharedInstanceData | TArray< TSharedPtr< FStateTreeInstanceData > > | StateTree.h | ||
| PerThreadSharedInstanceDataLock | FTransactionallySafeRWLock | StateTree.h | ||
| PostGCHandle | FDelegateHandle | StateTree.h | ||
| PreGCHandle | FDelegateHandle | StateTree.h | ||
| PropertyBindings | FStateTreePropertyBindings | StateTree.h | ||
| PropertyFunctionEvaluationScopeMemoryRequirements | TArray< FMemoryRequirement > | The amount of memory used by property binding copy info batch for property function. | StateTree.h | |
| Schema | TObjectPtr< UStateTreeSchema > | Schema used to compile the StateTree. | StateTree.h |
|
| SharedInstanceData | FStateTreeInstanceData | Shared node instance data (e.g. conditions, considerations). | StateTree.h | |
| States | TArray< FCompactStateTreeState > | Runtime states, root state at index 0 | StateTree.h | |
| StateSelectionRules | EStateTreeStateSelectionRules | The cached value of UStateTreeSchema::GetStateSelectionRules | StateTree.h | |
| Transitions | TArray< FCompactStateTransition > | Runtime transitions. | StateTree.h | |
| TStateTreeStrongExecutionContext< true > | friend | StateTree.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TArray< FStateTreeMemoryUsage > CalculateEstimatedMemoryUsage() |
Calculates runtime memory usage for different sections of the tree. | StateTree.h | |
void CompileIfChanged() |
Compile the state trees if the editor hash data as changed since the last compilation. | StateTree.h | |
FString DebugInternalLayoutAsString() |
StateTree.h | ||
bool DoesRequestTickGlobalTasks
(
bool bHasEvents |
StateTree.h | ||
TConstArrayView< FStateTreeExternalDataDesc > GetContextDataDescs() |
StateTree.h | ||
const UE::StateTree::InstanceData::FInstanceContainer & GetDefaultEvaluationScopeInstanceData() |
StateTree.h | ||
const UE::StateTree::InstanceData::FInstanceContainer & GetDefaultExecutionRuntimeData() |
StateTree.h | ||
const FStateTreeInstanceData & GetDefaultInstanceData() |
StateTree.h | ||
const FInstancedPropertyBag & GetDefaultParameters() |
StateTree.h | ||
const ExtensionType * GetExtension() |
Find the first extension of the requested type. | StateTree.h | |
TConstArrayView< UStateTreeExtension * > GetExtensions() |
StateTree.h | ||
TConstArrayView< FStateTreeExternalDataDesc > GetExternalDataDescs() |
StateTree.h | ||
const FCompactStateTreeFrame * GetFrameFromHandle
(
const FStateTreeStateHandle StateHandle |
StateTree.h | ||
const uint16 GetGlobalEvaluatorsBegin() |
StateTree.h | ||
const uint16 GetGlobalEvaluatorsNum() |
StateTree.h | ||
const uint16 GetGlobalTasksBegin() |
StateTree.h | ||
const uint16 GetGlobalTasksNum() |
StateTree.h | ||
FConstStructView GetNode
(
const int32 NodeIndex |
StateTree.h | ||
FGuid GetNodeIdFromIndex
(
const FStateTreeIndex16 NodeIndex |
StateTree.h | ||
FStateTreeIndex16 GetNodeIndexFromId
(
const FGuid Id |
StateTree.h | ||
const FInstancedStructContainer & GetNodes() |
StateTree.h | ||
int32 GetNumContextDataViews() |
StateTree.h | ||
const FStateTreePropertyBindings & GetPropertyBindings() |
StateTree.h | ||
const UStateTreeSchema * GetSchema() |
StateTree.h | ||
TSharedPtr< FStateTreeInstanceData > GetSharedInstanceData() |
StateTree.h | ||
const FCompactStateTreeState * GetStateFromHandle
(
const FStateTreeStateHandle StateHandle |
StateTree.h | ||
FStateTreeStateHandle GetStateHandleFromId
(
const FGuid Id |
StateTree.h | ||
FGuid GetStateIdFromHandle
(
const FStateTreeStateHandle Handle |
StateTree.h | ||
TConstArrayView< FCompactStateTreeState > GetStates() |
StateTree.h | ||
EStateTreeStateSelectionRules GetStateSelectionRules() |
StateTree.h | ||
const FCompactStateTransition * GetTransitionFromIndex
(
const FStateTreeIndex16 TransitionIndex |
StateTree.h | ||
FGuid GetTransitionIdFromIndex
(
const FStateTreeIndex16 Index |
StateTree.h | ||
FStateTreeIndex16 GetTransitionIndexFromId
(
const FGuid Id |
StateTree.h | ||
bool HasCompatibleContextData
(
const UStateTree& Other |
StateTree.h | ||
bool HasCompatibleContextData
(
TNotNull< const UStateTree* > Other |
StateTree.h | ||
bool IsReadyToRun() |
StateTree.h | ||
bool IsScheduledTickAllowed() |
StateTree.h | ||
const UStateTreeExtension * K2_GetExtension
(
TSubclassOf< UStateTreeExtension > ExtensionType |
Find the first extension of the requested type. | StateTree.h |
|
void OnPreBeginPIE
(
const bool bIsSimulating |
Called when the editor is preparing to start a pie session. | StateTree.h | |
void ResetCompiled() |
Resets the compiled data to empty. | StateTree.h | |
bool ShouldTickGlobalTasks
(
bool bHasEvents |
StateTree.h |
Overridden from UObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual EDataValidationResult IsDataValid
(
FDataValidationContext& Context |
StateTree.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool Link() |
Resolves references between data in the StateTree. | StateTree.h |
Overridden from UObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void BeginDestroy() |
StateTree.h | ||
virtual void GetAssetRegistryTags
(
FAssetRegistryTagsContext Context |
StateTree.h | ||
virtual void PostDuplicate
(
EDuplicateMode::Type DuplicateMode |
StateTree.h | ||
virtual void PostInitProperties() |
StateTree.h | ||
virtual void PostLoad() |
StateTree.h | ||
virtual void Serialize
(
FStructuredArchiveRecord Record |
StateTree.h | ||
virtual void ThreadedPostLoadAssetRegistryTagsOverride
(
FPostLoadAssetRegistryTagsContext& Context |
StateTree.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static void AddReferencedObjects
(
UObject* InThis, |
StateTree.h | ||
static void DeclareConstructClasses
(
TArray< FTopLevelAssetPath >& OutConstructClasses, |
StateTree.h |