Files
UnrealEngineUWP/Engine/Plugins/Runtime/GameplayInteractions/Source/GameplayInteractionsModule/Private/GameplayInteractionStateTreeSchema.cpp
Yoan StAmant 726e6251f3 GameplayInteractions plugin
- base class for StateTree tasks (GameplayInteractionStateTreeTask)
- GameplayInteractions StateTree schema
   - supports StateTree common Tasks, Evaluators and Conditions + GameplayInteraction Tasks
   - requires two named external data items (Interactable actor and SmartObject claimed handle)
- GameplayInteraction specific SmartObjectBehaviorDefinition to execute a StateTree
- First pass of ContextualAnimStateTreeTask to play a scene from a ContextualAnimation scene asset
#rnx
#rb mikko.mononen
#preflight 627510442e58cb727d38e384

[CL 20074106 by Yoan StAmant in ue5-main branch]
2022-05-06 08:23:48 -04:00

40 lines
1.6 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "GameplayInteractionStateTreeSchema.h"
#include "GameplayInteractionsTypes.h"
#include "SmartObjectRuntime.h"
#include "StateTreeConditionBase.h"
#include "StateTreeEvaluatorBase.h"
#include "StateTreeTaskBase.h"
#include "GameFramework/Actor.h"
#include "Components/ActorComponent.h"
#include "Subsystems/WorldSubsystem.h"
UGameplayInteractionStateTreeSchema::UGameplayInteractionStateTreeSchema()
: NamedExternalDataDescs({
{UE::GameplayInteraction::Names::InteractableActor, AActor::StaticClass(), FGuid(TEXT("870E433F-9931-4B95-982B-78B01B63BBD1"))},
{UE::GameplayInteraction::Names::SmartObjectClaimedHandle, FSmartObjectClaimHandle::StaticStruct(), FGuid(TEXT("13BAB427-26DB-4A4A-BD5F-937EDB39F841"))}
})
{
}
bool UGameplayInteractionStateTreeSchema::IsStructAllowed(const UScriptStruct* InScriptStruct) const
{
return InScriptStruct->IsChildOf(FStateTreeConditionCommonBase::StaticStruct())
|| InScriptStruct->IsChildOf(FStateTreeEvaluatorCommonBase::StaticStruct())
|| InScriptStruct->IsChildOf(FStateTreeTaskCommonBase::StaticStruct())
|| InScriptStruct->IsChildOf(FGameplayInteractionStateTreeTask::StaticStruct());
}
bool UGameplayInteractionStateTreeSchema::IsClassAllowed(const UClass* InClass) const
{
return IsChildOfBlueprintBase(InClass);
}
bool UGameplayInteractionStateTreeSchema::IsExternalItemAllowed(const UStruct& InStruct) const
{
return InStruct.IsChildOf(AActor::StaticClass())
|| InStruct.IsChildOf(UActorComponent::StaticClass())
|| InStruct.IsChildOf(UWorldSubsystem::StaticClass());
}