Files
UnrealEngineUWP/Engine/Plugins/Runtime/StateTree/Source/StateTreeModule/Public/StateTreeSchema.h
mikko mononen c866e28ab8 StateTree: allow schema to configure editor
- allow to disable enter conditions and evaluators
- allow to configure state to have just one task

#jira UE-135723
#preflight 61b067d35c61dba07bef0718

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

[CL 18403964 by mikko mononen in ue5-release-engine-test branch]
2021-12-08 03:32:02 -05:00

56 lines
1.9 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "StateTreeSchema.generated.h"
/**
* Schema describing which inputs, evaluators, and tasks a StateTree can contain.
* Each StateTree asset saves the schema class name in asset data tags, which can be
* used to limit which StatTree assets can be selected per use case, i.e.:
*
* UPROPERTY(EditDefaultsOnly, Category = AI, meta=(RequiredAssetDataTags="Schema=StateTreeSchema_SupaDupa"))
* UStateTree* StateTree;
*
*/
UCLASS(Abstract)
class STATETREEMODULE_API UStateTreeSchema : public UObject
{
GENERATED_BODY()
public:
/** @return Returns the script struct the storage struct will be derived from. */
virtual UScriptStruct* GetStorageSuperStruct() const { return nullptr; }
/** @return True if specified struct is supported */
virtual bool IsStructAllowed(const UScriptStruct* InScriptStruct) const { return false; }
/** @return True if specified class is supported */
virtual bool IsClassAllowed(const UClass* InScriptStruct) const { return false; };
/** @return True if specified struct/class is supported as external data */
virtual bool IsExternalItemAllowed(const UStruct& InStruct) const { return false; };
/**
* Helper function to check if a class is any of the Blueprint extendable item classes (Eval, Task, Condition).
* Can be used to quickly accept all of those classes in IsClassAllowed().
* @return True if the class is a StateTree item Blueprint base class.
*/
bool IsChildOfBlueprintBase(const UClass* InClass) const;
#if WITH_EDITOR
/** @return True if enter conditions are allowed. */
virtual bool AllowEnterConditions() const { return true; }
/** @return True if evaluators are allowed. */
virtual bool AllowEvaluators() const { return true; }
/** @return True if multiple tasks are allowed. */
virtual bool AllowMultipleTasks() const { return true; }
#endif // WITH_EDITOR
};