You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#fyi Yoan.StAmant #rb trivial #preflight none #jira UE-148959 [CL 19766383 by aurel cordonnier in ue5-main branch]
59 lines
1.5 KiB
C++
59 lines
1.5 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "UObject/Object.h"
|
|
#include "StateTreeTypes.h"
|
|
#include "StateTreeReference.generated.h"
|
|
|
|
class UStateTree;
|
|
|
|
/**
|
|
* Struct to hold reference to a StateTree asset along with values to parameterized it.
|
|
*/
|
|
USTRUCT()
|
|
struct FStateTreeReference
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
UPROPERTY(EditDefaultsOnly, Category="")
|
|
TObjectPtr<UStateTree> StateTree = nullptr;
|
|
|
|
UPROPERTY(EditDefaultsOnly, Category="")
|
|
FStateTreeParameters Parameters;
|
|
|
|
#if WITH_EDITOR
|
|
/**
|
|
* Make sure that parameters are still compatible with those available in the selected StateTree asset.
|
|
* @return true when parameters were 'fixed' to be in sync, false if they were already synced (i.e. unchanged).
|
|
*/
|
|
bool SyncParameters();
|
|
#endif
|
|
};
|
|
|
|
|
|
/**
|
|
* Utility class wrapping a StateTreeReference to handle Editor actions to keep parameters synced.
|
|
*/
|
|
UCLASS(EditInlineNew)
|
|
class STATETREEMODULE_API UStateTreeReferenceWrapper : public UObject
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
UPROPERTY(EditDefaultsOnly, Category="")
|
|
FStateTreeReference StateTreeReference;
|
|
|
|
protected:
|
|
#if WITH_EDITOR
|
|
virtual void PostEditChangeProperty(struct FPropertyChangedEvent& PropertyChangedEvent) override;
|
|
virtual void PostEditChangeChainProperty(FPropertyChangedChainEvent& PropertyChangedEvent) override;
|
|
virtual void PostInitProperties() override;
|
|
virtual void PostLoad() override;
|
|
virtual void BeginDestroy() override;
|
|
|
|
FDelegateHandle PostCompileHandle;
|
|
FDelegateHandle PIEHandle;
|
|
#endif
|
|
};
|