You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
- Added option to start the StateTree automatically on BeginPlay - StateTreeComponentSchema: allow to specify which actor class to expect the StateTree to run on (allows to bind to Actor specific data directly) - Fixed FStateTreeReference parameter update on BP instance (the struct gets copied, which cause issues with the delegate handle) #rb Mieszko.Zielinski #preflight 630c70bb0345de4ccf7c8b51 [CL 21685020 by mikko mononen in ue5-main branch]
33 lines
988 B
C++
33 lines
988 B
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "StateTreeReference.h"
|
|
#include "StateTree.h"
|
|
|
|
void FStateTreeReference::SyncParametersToMatchStateTree(FInstancedPropertyBag& ParametersToSync) const
|
|
{
|
|
if (StateTree == nullptr)
|
|
{
|
|
ParametersToSync.Reset();
|
|
}
|
|
else
|
|
{
|
|
ParametersToSync.MigrateToNewBagInstance(StateTree->GetDefaultParameters());
|
|
}
|
|
}
|
|
|
|
bool FStateTreeReference::RequiresParametersSync() const
|
|
{
|
|
return (StateTree == nullptr && Parameters.IsValid())
|
|
|| (StateTree != nullptr && StateTree->GetDefaultParameters().GetPropertyBagStruct() != Parameters.GetPropertyBagStruct());
|
|
}
|
|
|
|
void FStateTreeReference::ConditionallySyncParameters() const
|
|
{
|
|
if (RequiresParametersSync())
|
|
{
|
|
FStateTreeReference* NonConstThis = const_cast<FStateTreeReference*>(this);
|
|
NonConstThis->SyncParameters();
|
|
UE_LOG(LogStateTree, Warning, TEXT("Parameters for '%s' stored in StateTreeReference were auto-fixed to be usable at runtime."), *GetNameSafe(StateTree));
|
|
}
|
|
}
|