You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
- Separated condition instance data into a shared instance data (mutable but no persistent state) - Made BP TestCondition() const, conditions should not hold state - Added macro to define runtime data POD for faster init - Added custom serialization version for UStateTree, older assets need recompile - Updated memory reporting to be a bit more accurate, separated shared and unique data #jira UE-147508 #rb Mieszko.Zielinski #preflight 627b657d2d608c533b5cde15 [CL 20134929 by mikko mononen in ue5-main branch]
43 lines
1.4 KiB
C++
43 lines
1.4 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "Blueprint/StateTreeConditionBlueprintBase.h"
|
|
#include "CoreMinimal.h"
|
|
#include "StateTreeExecutionContext.h"
|
|
#include "Engine/Blueprint.h"
|
|
|
|
//----------------------------------------------------------------------//
|
|
// UStateTreeConditionBlueprintBase
|
|
//----------------------------------------------------------------------//
|
|
|
|
bool UStateTreeConditionBlueprintBase::TestCondition(FStateTreeExecutionContext& Context) const
|
|
{
|
|
AActor* OwnerActor = GetOwnerActor(Context);
|
|
return ReceiveTestCondition(OwnerActor);
|
|
}
|
|
|
|
//----------------------------------------------------------------------//
|
|
// FStateTreeBlueprintConditionWrapper
|
|
//----------------------------------------------------------------------//
|
|
|
|
bool FStateTreeBlueprintConditionWrapper::Link(FStateTreeLinker& Linker)
|
|
{
|
|
const UStateTreeConditionBlueprintBase* CondCDO = ConditionClass ? ConditionClass->GetDefaultObject<UStateTreeConditionBlueprintBase>() : nullptr;
|
|
if (CondCDO != nullptr)
|
|
{
|
|
CondCDO->LinkExternalData(Linker, ExternalDataHandles);
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
bool FStateTreeBlueprintConditionWrapper::TestCondition(FStateTreeExecutionContext& Context) const
|
|
{
|
|
if (UStateTreeConditionBlueprintBase* Instance = Context.GetInstanceObjectInternal<UStateTreeConditionBlueprintBase>(DataViewIndex))
|
|
{
|
|
Instance->CopyExternalData(Context, ExternalDataHandles);
|
|
return Instance->TestCondition(Context);
|
|
}
|
|
return false;
|
|
}
|
|
|