USMStateInstance¶
Module: SMSystem
#include <SMStateInstance.h>
Inherits from USMStateInstance_Base, USMNodeInstance, UObject
Description¶
The base class for state nodes. This is where most execution logic should be defined.
Public Functions¶
| Name | |
|---|---|
| USMStateInstance() | |
| void | OnStateInitialized() ![]() |
| void | OnStateShutdown() ![]() |
| void | GetAllStateStackInstances(TArray< USMStateInstance_Base * > & StateStackInstances) const ![]() |
| USMStateInstance_Base * | GetStateInStack(int32 Index) const ![]() |
| USMStateInstance_Base * | GetStateInStackByClass(TSubclassOf< USMStateInstance > StateClass, bool bIncludeChildren =false) const ![]() |
| USMStateInstance_Base * | GetStackOwnerInstance() const ![]() |
| void | GetAllStatesInStackOfClass(TSubclassOf< USMStateInstance > StateClass, TArray< USMStateInstance_Base * > & StateStackInstances, bool bIncludeChildren =false) const ![]() |
| int32 | GetStateIndexInStack(USMStateInstance_Base * StateInstance) const ![]() |
| int32 | GetStateStackCount() const ![]() |
| USMStateInstance * | AddStateToStack(TSubclassOf< USMStateInstance > StateClass, int32 StackIndex =-1) ![]() |
| void | RemoveStateFromStack(int32 StackIndex =-1) ![]() |
| void | ClearStateStack() ![]() |
Protected Functions¶
| Name | |
|---|---|
| virtual void | OnStateInitialized_Implementation() |
| virtual void | OnStateShutdown_Implementation() |
Additional inherited members¶
Public Functions inherited from USMStateInstance_Base
| Name | |
|---|---|
| USMStateInstance_Base() | |
| virtual bool | IsInEndState() const override |
| void | OnStateBegin() ![]() |
| void | OnStateUpdate(float DeltaSeconds) ![]() |
| void | OnStateEnd() ![]() |
| bool | IsEndState() const ![]() |
| void | GetStateInfo(FSMStateInfo & State) const ![]() |
| bool | IsStateMachine() const ![]() |
| bool | IsEntryState() const ![]() |
| void | SetActive(bool bValue, bool bSetAllParents =false, bool bActivateNow =true) ![]() |
| void | EvaluateTransitions() ![]() |
| bool | GetOutgoingTransitions(TArray< USMTransitionInstance * > & Transitions, bool bExcludeAlwaysFalse =true) const ![]() |
| bool | GetIncomingTransitions(TArray< USMTransitionInstance * > & Transitions, bool bExcludeAlwaysFalse =true) const ![]() |
| USMTransitionInstance * | GetTransitionToTake() const ![]() |
| bool | SwitchToLinkedState(USMStateInstance_Base * NextStateInstance, bool bRequireTransitionToPass =true, bool bActivateNow =true) ![]() |
| bool | SwitchToLinkedStateByName(const FString & NextStateName, bool bRequireTransitionToPass =true, bool bActivateNow =true) ![]() |
| bool | SwitchToLinkedStateByTransition(USMTransitionInstance * TransitionInstance, bool bRequireTransitionToPass =true, bool bActivateNow =true) ![]() |
| bool | SwitchToLinkedStateByTransitionName(const FString & TransitionName, bool bRequireTransitionToPass =true, bool bActivateNow =true) ![]() |
| USMTransitionInstance * | GetTransitionByIndex(int32 Index) const ![]() |
| USMTransitionInstance * | GetOutgoingTransitionByName(const FString & Name) const ![]() |
| USMTransitionInstance * | GetIncomingTransitionByName(const FString & Name) const ![]() |
| USMStateInstance_Base * | GetNextStateByTransitionIndex(int32 Index) const ![]() |
| USMStateInstance_Base * | GetNextStateByName(const FString & StateName) const ![]() |
| USMStateInstance_Base * | GetPreviousStateByName(const FString & StateName) const ![]() |
| USMStateInstance_Base * | GetPreviousActiveState() const ![]() |
| USMTransitionInstance * | GetPreviousActiveTransition() const ![]() |
| bool | AreAllOutgoingTransitionsFromAnAnyState() const ![]() |
| bool | AreAllIncomingTransitionsFromAnAnyState() const ![]() |
| const FDateTime & | GetStartTime() const ![]() |
| float | GetServerTimeInState(bool & bOutUsedLocalTime) const ![]() |
| void | GetAllNodesOfType(TArray< USMNodeInstance * > & OutNodes, TSubclassOf< USMNodeInstance > NodeClass, bool bIncludeChildren =true, const TArray< UClass * > & StopIfTypeIsNot =TArray< UClass * >()) const |
| const FLinearColor & | GetEndStateColor() const |
| bool | ShouldDisplayNameWidget() const |
| bool | ShouldUseDisplayNameOnly() const |
| const FSMStateConnectionValidator & | GetAllowedConnections() const |
| virtual bool | IsRegisteredWithContextMenu() const |
| virtual bool | HideFromContextMenuIfRulesFail() const |
| bool | GetAlwaysUpdate() const ![]() |
| void | SetAlwaysUpdate(const bool bValue) ![]() |
| bool | GetDisableTickTransitionEvaluation() const ![]() |
| void | SetDisableTickTransitionEvaluation(const bool bValue) ![]() |
| bool | GetDefaultToParallel() const ![]() |
| void | SetDefaultToParallel(const bool bValue) ![]() |
| bool | GetAllowParallelReentry() const ![]() |
| void | SetAllowParallelReentry(const bool bValue) ![]() |
| bool | GetStayActiveOnStateChange() const ![]() |
| void | SetStayActiveOnStateChange(const bool bValue) ![]() |
| bool | GetEvalTransitionsOnStart() const ![]() |
| void | SetEvalTransitionsOnStart(const bool bValue) ![]() |
| bool | GetExcludeFromAnyState() const ![]() |
| void | SetExcludeFromAnyState(const bool bValue) ![]() |
| bool | GetCanBeEndState() const ![]() |
| void | SetCanBeEndState(const bool bValue) ![]() |
| FName | GetHideFromContextMenuIfRulesFailPropertyName() |
| FName | GetRegisteredWithContextMenuPropertyName() |
Protected Functions inherited from USMStateInstance_Base
| Name | |
|---|---|
| virtual void | OnStateBegin_Implementation() |
| virtual void | OnStateUpdate_Implementation(float DeltaSeconds) |
| virtual void | OnStateEnd_Implementation() |
Public Attributes inherited from USMStateInstance_Base
| Name | |
|---|---|
| uint8 | bEvalGraphsOnStart |
| uint8 | bEvalGraphsOnUpdate |
| uint8 | bEvalGraphsOnEnd |
| uint8 | bEvalGraphsOnRootStateMachineStart |
| uint8 | bEvalGraphsOnRootStateMachineStop |
| FOnStateBeginSignature | OnStateBeginEvent |
| FOnStateBeginSignature | OnPostStateBeginEvent |
| FOnStateUpdateSignature | OnStateUpdateEvent |
| FOnStateEndSignature | OnStateEndEvent |
Protected Attributes inherited from USMStateInstance_Base
| Name | |
|---|---|
| FLinearColor | NodeEndStateColor |
| FSMStateConnectionValidator | ConnectionRules |
| uint16 | bHideFromContextMenuIfRulesFail |
| uint16 | bRegisterWithContextMenu |
| uint16 | bShowDisplayNameOnly |
| uint16 | bDisplayNameWidget |
Friends inherited from USMStateInstance_Base
| Name | |
|---|---|
| class | USMGraphNode_StateNodeBase |
Public Functions inherited from USMNodeInstance
| Name | |
|---|---|
| USMNodeInstance() | |
| virtual void | Serialize(FArchive & Ar) override |
| virtual UWorld * | GetWorld() const override |
| virtual void | BeginDestroy() override |
| virtual UObject * | GetContext() const override ![]() |
| virtual void | NativeInitialize() |
| virtual void | NativeShutdown() |
| void | OnRootStateMachineStart() ![]() |
| void | OnRootStateMachineStop() ![]() |
| void | RunConstructionScript() |
| bool | ShouldSkipNativeEditorConstructionScripts() const |
| USMInstance * | GetStateMachineInstance(bool bTopMostInstance =false) const ![]() |
| void | SetOwningNode(FSMNode_Base * Node, bool bInIsEditorExecution =false) |
| const FSMNode_Base * | GetOwningNode() const |
| T * | GetOwningNodeAs() const |
| virtual const FSMNode_Base * | GetOwningNodeContainer() const |
| USMStateMachineInstance * | GetOwningStateMachineNodeInstance() const ![]() |
| TScriptInterface< ISMStateMachineNetworkedInterface > | GetNetworkInterface() const ![]() |
| virtual float | GetTimeInState() const ![]() |
| virtual bool | IsInEndState() const |
| virtual bool | HasUpdated() const ![]() |
| bool | IsActive() const ![]() |
| const FString & | GetNodeName() const ![]() |
| const FGuid & | GetGuid() const ![]() |
| UTexture2D * | GetNodeIcon() const |
| FVector2D | GetNodeIconSize() const |
| FLinearColor | GetNodeIconTintColor() const |
| void | EvaluateGraphProperties(bool bTargetOnly =false) ![]() |
| const FGuid & | GetTemplateGuid() const |
| const FVector2D & | GetNodePosition() const ![]() |
| bool | IsInitialized() const ![]() |
| bool | IsInitializedAndReadyForInputEvents() const |
| FSMGraphProperty * | FindExposedPropertyOverrideByName(const FName & VariableName) const |
| virtual void | PostEditChangeProperty(FPropertyChangedEvent & PropertyChangedEvent) override |
| bool | WasArrayPropertyModified(const FName & PropertyName) const |
| bool | IsNodePinChanging() const |
| void | SetDisplayName(FName NewDisplayName) ![]() |
| void | SetNodeDescriptionText(FText NewDescription) ![]() |
| FText | GetNodeDescriptionText() const ![]() |
| void | SetNodeColor(FLinearColor NewColor) ![]() |
| void | SetUseCustomColor(bool bValue) ![]() |
| void | SetUseCustomIcon(bool bValue) |
| void | SetVariableReadOnly(FName VariableName, bool bSetIsReadOnly) ![]() |
| void | SetVariableHidden(FName VariableName, bool bSetHidden) ![]() |
| bool | IsEditorExecution() const ![]() |
| void | WithExecutionEnvironment(ESMExecutionEnvironment & ExecutionEnvironment) ![]() |
| TScriptInterface< ISMEditorGraphNodeInterface > | GetOwningEditorGraphNode() const ![]() |
| void | K2_TryGetOwningEditorGraphNode(TScriptInterface< ISMEditorGraphNodeInterface > & EditorNode, ESMValidEditorNode & IsValidNode) const ![]() |
| bool | IsInitializationThreadSafe() const |
| void | ResetVariables() ![]() |
| bool | GetResetVariablesOnInitialize() const |
| bool | HasCustomColor() const |
| const FLinearColor & | GetNodeColor() const |
| const FSMNodeDescription & | GetNodeDescription() const |
| bool | HasCustomIcon() const |
| FString | GetNodeDisplayName() const |
| void | SetTemplateGuid(const FGuid & NewTemplateGuid) |
| void | SetIsThreadSafe(bool bNewValue) |
| void | SetIsEditorThreadSafe(const bool bNewValue) |
| bool | GetIsEditorThreadSafe() const |
| TEnumAsByte< ESMNodeInput::Type > | GetInputType() const |
| int32 | GetInputPriority() const |
| bool | GetBlockInput() const |
| UInputComponent * | GetInputComponent() const ![]() |
| FName | GetConstructionScriptFunctionName() |
| FName | GetNodeDescriptionPropertyName() |
| FName | GetHideFromDropDownIfRulesFailPropertyName() |
Protected Functions inherited from USMNodeInstance
| Name | |
|---|---|
| virtual void | OnRootStateMachineStart_Implementation() |
| virtual void | OnRootStateMachineStop_Implementation() |
| void | ConstructionScript() ![]() |
| FSMGraphProperty * | FindOrAddExposedPropertyOverrideByName(const FName & VariableName) |
| void | OnPreCompileValidate(USMCompilerLog * CompilerLog) const |
| virtual void | OnPreCompileValidate_Implementation(USMCompilerLog * CompilerLog) const |
| virtual void | ConstructionScript_Implementation() |
| virtual UTexture2D * | GetNodeIcon_Implementation() const |
| virtual FVector2D | GetNodeIconSize_Implementation() const |
| virtual FLinearColor | GetNodeIconTintColor_Implementation() const |
| void | EnableInput() Input. |
| void | DisableInput() |
| void | OnContextPawnControllerChanged(APawn * Pawn, AController * NewController) |
Public Attributes inherited from USMNodeInstance
| Name | |
|---|---|
| TArray< FSMGraphProperty > | ExposedPropertyOverrides |
| uint8 | bEvalDefaultProperties |
| uint8 | bAutoEvalExposedProperties |
Protected Attributes inherited from USMNodeInstance
| Name | |
|---|---|
| bool | bSkipNativeEditorConstructionScripts |
| TObjectPtr< UTexture2D > | NodeIcon |
| FVector2D | NodeIconSize |
| FLinearColor | NodeIconTintColor |
| bool | bResetVariablesOnInitialize |
| FSMNodeDescription | NodeDescription |
| FLinearColor | NodeColor |
| uint8 | bDisplayCustomIcon |
| uint8 | bUseCustomColors |
| uint8 | bHideFromDropDownIfRulesFail |
| TObjectPtr< UInputComponent > | InputComponent |
| TEnumAsByte< ESMNodeInput::Type > | AutoReceiveInput |
| int32 | InputPriority |
| uint8 | bBlockInput |
Friends inherited from USMNodeInstance
| Name | |
|---|---|
| class | USMGraphNode_StateNode |
| class | USMGraphNode_TransitionEdge |
| struct | FSMNode_Base(FSMNode_Base ) |
| class | USMGraphNode_Base |
| class | USMGraphK2Node_PropertyNode_Base |
Public Functions Documentation¶
function USMStateInstance¶
function OnStateInitialized¶

Called before OnStateBegin and before transitions are initialized.
function OnStateShutdown¶

Called after OnStateEnd and after transitions are shutdown.
function GetAllStateStackInstances¶

Retrieve all state instances in the state stack.
Parameters:
StateStackInstances- [Out] State stack instances in their correct order.
function GetStateInStack¶

Retrieve a state instance from within the state stack.
Parameters:
Index- the index of the array.
Return: the state if the index is valid.
function GetStateInStackByClass¶
USMStateInstance_Base * GetStateInStackByClass(
TSubclassOf< USMStateInstance > StateClass,
bool bIncludeChildren =false
) const

Retrieve the first stack instance of a given class.
Parameters:
StateClass- The state class to search for.
bIncludeChildren- If children of the given class can be included.
Return: the first state that matches the class.
function GetStackOwnerInstance¶

Retrieve the owning node instance of a state stack. If this is called from the main node instance it will return itself.
function GetAllStatesInStackOfClass¶
void GetAllStatesInStackOfClass(
TSubclassOf< USMStateInstance > StateClass,
TArray< USMStateInstance_Base * > & StateStackInstances,
bool bIncludeChildren =false
) const

Retrieve all states that match the given class.
Parameters:
StateClass- The state class to search for.
bIncludeChildren- If children of the given class can be included.
StateStackInstances- [Out] State stack instances matching the given class.
function GetStateIndexInStack¶

Retrieve the index of a state stack instance. O(n).
Parameters:
StateInstance- The state instance to lookup in the stack.
Return: The index of the state in the stack. -1 if not found or is the base state instance.
function GetStateStackCount¶

The total number of states in the state stack.
function AddStateToStack¶
USMStateInstance * AddStateToStack(
TSubclassOf< USMStateInstance > StateClass,
int32 StackIndex =-1
)

Add a state to the state stack. For use during editor construction scripts only.
Parameters:
StateClass- The state class to be created.
StackIndex- The index to insert the node stack. Leave at -1 to place at the end.
Return: The stack instance created.
function RemoveStateFromStack¶

Remove a state from the stack by index. For use during editor construction scripts only.
Parameters:
StackIndex- The index to remove. Leave at -1 to remove from the end.
function ClearStateStack¶

Remove all states from the state stack. For use during editor construction scripts only.







































































