You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#rb trivial #jira none #preflight 61acb115832ebaf948859b99 #ROBOMERGE-AUTHOR: mark.lintott #ROBOMERGE-SOURCE: CL 18378206 in //UE5/Release-5.0/... via CL 18378220 #ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469) [CL 18378225 by mark lintott in ue5-release-engine-test branch]
64 lines
2.0 KiB
C++
64 lines
2.0 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)
|
|
{
|
|
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;
|
|
}
|
|
|
|
#if WITH_EDITOR
|
|
FText FStateTreeBlueprintConditionWrapper::GetDescription(const FGuid& ID, FStateTreeDataView InstanceData, const IStateTreeBindingLookup& BindingLookup) const
|
|
{
|
|
const UClass* Class = Cast<const UClass>(InstanceData.GetStruct());
|
|
|
|
if (Class != nullptr)
|
|
{
|
|
if (UBlueprint* ClassBP = Cast<UBlueprint>(Class->ClassGeneratedBy))
|
|
{
|
|
if (!ClassBP->BlueprintDescription.IsEmpty())
|
|
{
|
|
return FText::FromString(ClassBP->BlueprintDescription);
|
|
}
|
|
}
|
|
|
|
return Class->GetDisplayNameText();
|
|
}
|
|
|
|
return FText::GetEmpty();
|
|
}
|
|
#endif
|