Files
UnrealEngineUWP/Engine/Plugins/Runtime/StateTree/Source/StateTreeModule/Private/Tasks/StateTreeDebugTextTask.h
mikko mononen 186e03b32e StateTree: Improved event handling
- Moved event queue to it's own struct
- Changed the SendEvent() API to accept struct view to prevent instanced struct copy in common cases
- Fixed event handling in case EnterState() fails.
- Added option for Tasks to disavble ticking, or to be ticked only when there are events
- Added option for Tasks handle when properties are copied
- Changed DebugText to use external Actor reference
- Changed DelayTask to use the new GetInstanceData which does not need type
- Added TStateTreeInstanceDataStructRef which can be used to access struct instance data in delegates

#rb Maxime.Mercier Luciano.Ferraro
#preflight 6360dd302b5338aceb2d0343

[CL 22888708 by mikko mononen in ue5-main branch]
2022-11-01 15:11:19 -04:00

50 lines
1.5 KiB
C

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "StateTreeTaskBase.h"
#include "StateTreeDebugTextTask.generated.h"
USTRUCT()
struct STATETREEMODULE_API FStateTreeDebugTextTaskInstanceData
{
GENERATED_BODY()
/** Optional actor where to draw the text at. */
UPROPERTY(EditAnywhere, Category = "Parameter")
TObjectPtr<AActor> ReferenceActor = nullptr;
};
/**
* Draws debug text on the HUD associated to the player controller.
*/
USTRUCT(meta = (DisplayName = "Debug Text Task"))
struct STATETREEMODULE_API FStateTreeDebugTextTask : public FStateTreeTaskCommonBase
{
GENERATED_BODY()
using FInstanceDataType = FStateTreeDebugTextTaskInstanceData;
FStateTreeDebugTextTask() = default;
virtual const UStruct* GetInstanceDataType() const override { return FInstanceDataType::StaticStruct(); }
virtual EStateTreeRunStatus EnterState(FStateTreeExecutionContext& Context, const FStateTreeTransitionResult& Transition) const override;
virtual void ExitState(FStateTreeExecutionContext& Context, const FStateTreeTransitionResult& Transition) const override;
UPROPERTY(EditAnywhere, Category = "Parameter")
FString Text;
UPROPERTY(EditAnywhere, Category = "Parameter")
FColor TextColor = FColor::White;
UPROPERTY(EditAnywhere, Category = "Parameter", meta=(ClampMin = 0, UIMin = 0))
float FontScale = 1.0f;
UPROPERTY(EditAnywhere, Category = "Parameter")
FVector Offset = FVector::ZeroVector;
UPROPERTY(EditAnywhere, Category = "Parameter")
bool bEnabled = true;
};