Files
UnrealEngineUWP/Engine/Plugins/Runtime/GameplayStateTree/Source/GameplayStateTreeModule/Private/Components/StateTreeComponentSchema.cpp
Yoan StAmant f4f130cbae GameplatStateTree Plugin
- moved StateTreeBrainComponent (from StateTreeModule) and renamed StateTreeComponent
- added FStateTreeTaskCommonBase (similar to FStateTreeTaskCommonCondition)
#rnx
#rb mikko.mononen
#preflight 626fd50d645c64f3a236325a

[CL 20007596 by Yoan StAmant in ue5-main branch]
2022-05-02 09:15:14 -04:00

29 lines
1022 B
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "Components/StateTreeComponentSchema.h"
#include "StateTreeConditionBase.h"
#include "StateTreeEvaluatorBase.h"
#include "StateTreeTaskBase.h"
#include "GameFramework/Actor.h"
#include "Components/ActorComponent.h"
#include "Subsystems/WorldSubsystem.h"
bool UStateTreeComponentSchema::IsStructAllowed(const UScriptStruct* InScriptStruct) const
{
return InScriptStruct->IsChildOf(FStateTreeConditionCommonBase::StaticStruct())
|| InScriptStruct->IsChildOf(FStateTreeEvaluatorCommonBase::StaticStruct())
|| InScriptStruct->IsChildOf(FStateTreeTaskCommonBase::StaticStruct());
}
bool UStateTreeComponentSchema::IsClassAllowed(const UClass* InClass) const
{
return IsChildOfBlueprintBase(InClass);
}
bool UStateTreeComponentSchema::IsExternalItemAllowed(const UStruct& InStruct) const
{
return InStruct.IsChildOf(AActor::StaticClass())
|| InStruct.IsChildOf(UActorComponent::StaticClass())
|| InStruct.IsChildOf(UWorldSubsystem::StaticClass());
}