Files
UnrealEngineUWP/Engine/Plugins/Runtime/StateTree/Source/StateTreeModule/Public/Blueprint/StateTreeItemBlueprintBase.h
mikko mononen 11ea4b3fa0 StateTree: UObject and BP support
- connect GetWorld() of FStateTreeExecutionContext explicitly to the owner
- take MassSignalSubsystem as parameter to FMassStateTreeExecutionContext directly
- separated DataViewIndex (what others see) and InstanceIndex/bInstanceIsObject (where the pointert comes from) on StateTree items
- allow item instance to be a struct or object
- added editor support for both struct or object based instance
- added Blueprint base classes for Eval, Task and Condition
- Update UStateTreeBrainComponent

#jira UE-135723

#ROBOMERGE-AUTHOR: mikko.mononen
#ROBOMERGE-SOURCE: CL 18280804 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v895-18170469)
#ROBOMERGE[STARSHIP]: UE5-Release-Engine-Staging Release-5.0

[CL 18280809 by mikko mononen in ue5-release-engine-test branch]
2021-11-24 04:26:29 -05:00

71 lines
1.8 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "StateTreeTypes.h"
#include "StateTreeItemBlueprintBase.generated.h"
struct FStateTreeExecutionContext;
UENUM()
enum class EStateTreeBlueprintPropertyCategory : uint8
{
NotSet,
Input,
Parameter,
Output,
ExternalData,
};
/** Additional information for properties, captured from property metadata. */
USTRUCT()
struct STATETREEMODULE_API FStateTreeBlueprintPropertyInfo
{
GENERATED_BODY()
FStateTreeBlueprintPropertyInfo() = default;
FStateTreeBlueprintPropertyInfo(const FName InPropertyName, const EStateTreeBlueprintPropertyCategory InCategory)
: PropertyName(InPropertyName), Category(InCategory)
{}
UPROPERTY()
FName PropertyName;
UPROPERTY()
EStateTreeBlueprintPropertyCategory Category;
};
/** Struct use to copy external data to the Blueprint item instance, resolved during StateTree linking. */
struct STATETREEMODULE_API FStateTreeBlueprintExternalDataHandle
{
const FProperty* Property = nullptr;
FStateTreeExternalDataHandle Handle;
};
UCLASS(Abstract)
class STATETREEMODULE_API UStateTreeItemBlueprintBase : public UObject
{
GENERATED_BODY()
public:
/** Called during link to collect external data handles. */
void LinkExternalData(FStateTreeLinker& Linker, TArray<FStateTreeBlueprintExternalDataHandle>& OutExternalDataHandles) const;
/** Called before call to logic functions to copy data from */
void CopyExternalData(FStateTreeExecutionContext& Context, TConstArrayView<FStateTreeBlueprintExternalDataHandle> ExternalDataHandles);
protected:
virtual UWorld* GetWorld() const override;
AActor* GetOwnerActor(const FStateTreeExecutionContext& Context) const;
#if WITH_EDITOR
virtual void PostCDOCompiled() override;
#endif
/** Metadata for properties */
UPROPERTY()
TArray<FStateTreeBlueprintPropertyInfo> PropertyInfos;
};