You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
- Removed unnecessary checks for specific transition (handled in enter state logic) - Added state type to StateTreeState, State, Group, or Linked - StateTreeState property customization hides properties based on type - Allow a state to link to another state - Changed baker binding validation to handle linked states - Added linked state handling in execution context - Updated UI deal with linked states - Updated gameplay debugger to deal with linked states - Moved automatic Root state adding from Editor data to editor open (tests were broken due to extra root state) - Fixed tests and added simple test for linked state - Added meta to tag to state link to allow to select only direct states (no next, etc) - Added counter to track state changes (mainly for debugging) #jira UE-147509 #review #preflight 624beb69637925b5d306d8e7 [CL 19621621 by mikko mononen in ue5-main branch]
66 lines
3.0 KiB
C++
66 lines
3.0 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "Templates/SubclassOf.h"
|
|
#include "StateTreeTypes.h"
|
|
#include "StateTreeTaskBase.h"
|
|
#include "StateTreePropertyBindings.h"
|
|
#include "StateTreeItemBlueprintBase.h"
|
|
#include "StateTreeTaskBlueprintBase.generated.h"
|
|
|
|
struct FStateTreeExecutionContext;
|
|
|
|
/*
|
|
* Base class for Blueprint based Tasks.
|
|
*/
|
|
UCLASS(Abstract, Blueprintable)
|
|
class STATETREEMODULE_API UStateTreeTaskBlueprintBase : public UStateTreeItemBlueprintBase
|
|
{
|
|
GENERATED_BODY()
|
|
public:
|
|
|
|
UFUNCTION(BlueprintNativeEvent, meta = (DisplayName = "EnterState"))
|
|
EStateTreeRunStatus ReceiveEnterState(AActor* OwnerActor, const EStateTreeStateChangeType ChangeType, const FStateTreeTransitionResult& Transition);
|
|
|
|
UFUNCTION(BlueprintImplementableEvent, meta = (DisplayName = "ExitState"))
|
|
void ReceiveExitState(AActor* OwnerActor, const EStateTreeStateChangeType ChangeType, const FStateTreeTransitionResult& Transition);
|
|
|
|
UFUNCTION(BlueprintImplementableEvent, meta = (DisplayName = "StateCompleted"))
|
|
void ReceiveStateCompleted(AActor* OwnerActor, const EStateTreeRunStatus CompletionStatus, const FStateTreeActiveStates CompletedActiveStates);
|
|
|
|
UFUNCTION(BlueprintImplementableEvent, meta = (DisplayName = "Tick"))
|
|
EStateTreeRunStatus ReceiveTick(AActor* OwnerActor, const float DeltaTime);
|
|
|
|
|
|
virtual EStateTreeRunStatus EnterState(FStateTreeExecutionContext& Context, const EStateTreeStateChangeType ChangeType, const FStateTreeTransitionResult& Transition);
|
|
|
|
virtual void ExitState(FStateTreeExecutionContext& Context, const EStateTreeStateChangeType ChangeType, const FStateTreeTransitionResult& Transition);
|
|
|
|
virtual void StateCompleted(FStateTreeExecutionContext& Context, const EStateTreeRunStatus CompletionStatus, const FStateTreeActiveStates& CompletedActiveStates);
|
|
|
|
virtual EStateTreeRunStatus Tick(FStateTreeExecutionContext& Context, const float DeltaTime);
|
|
};
|
|
|
|
/**
|
|
* Wrapper for Blueprint based Tasks.
|
|
*/
|
|
USTRUCT()
|
|
struct STATETREEMODULE_API FStateTreeBlueprintTaskWrapper : public FStateTreeTaskBase
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
virtual const UStruct* GetInstanceDataType() const override { return TaskClass; };
|
|
virtual bool Link(FStateTreeLinker& Linker) override;
|
|
virtual EStateTreeRunStatus EnterState(FStateTreeExecutionContext& Context, const EStateTreeStateChangeType ChangeType, const FStateTreeTransitionResult& Transition) const override;
|
|
virtual void ExitState(FStateTreeExecutionContext& Context, const EStateTreeStateChangeType ChangeType, const FStateTreeTransitionResult& Transition) const override;
|
|
virtual void StateCompleted(FStateTreeExecutionContext& Context, const EStateTreeRunStatus CompletionStatus, const FStateTreeActiveStates& CompletedActiveStates) const override;
|
|
virtual EStateTreeRunStatus Tick(FStateTreeExecutionContext& Context, const float DeltaTime) const override;
|
|
|
|
UPROPERTY()
|
|
TSubclassOf<UStateTreeTaskBlueprintBase> TaskClass = nullptr;
|
|
|
|
TArray<FStateTreeBlueprintExternalDataHandle> ExternalDataHandles;
|
|
};
|