You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
- Added StateTree events, which allows e.g. transitions based on internal or external events - Clarified transition nomenclature - Update UI to support transition events - BP support for events - Renamed UStateTreeItemBase to UStateTreeNodeBase for consistency with FStateTreeNodeBase #jira UE-156543 #rb Mieszko.Zielinski #preflight 631077ef660db81edbd068ca [CL 21738918 by mikko mononen in ue5-main branch]
44 lines
1.5 KiB
C++
44 lines
1.5 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
|
|
{
|
|
FScopedCurrentContext(*this, 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.GetInstanceDataPtr<UStateTreeConditionBlueprintBase>(*this))
|
|
{
|
|
Instance->CopyExternalData(Context, ExternalDataHandles);
|
|
return Instance->TestCondition(Context);
|
|
}
|
|
return false;
|
|
}
|
|
|