You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
- StateTree asset allowed by a StateTreeReference can be filtered by using "meta=(schema="SomeSchema")" on the UPROPERTY of type StateTreeReference. #rnx #rb mikko.mononen #preflight 627a6fd7e713fc6e2c4cddae [CL 20122645 by Yoan StAmant in ue5-main branch]
61 lines
1.5 KiB
C++
61 lines
1.5 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#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 STATETREEMODULE_API FStateTreeReference
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
FStateTreeReference();
|
|
~FStateTreeReference();
|
|
|
|
UPROPERTY(EditDefaultsOnly, Category="")
|
|
TObjectPtr<UStateTree> StateTree = nullptr;
|
|
|
|
UPROPERTY(EditDefaultsOnly, Category="", meta=(FixedLayout))
|
|
FInstancedPropertyBag Parameters;
|
|
|
|
#if WITH_EDITOR
|
|
void PostSerialize(const FArchive& Ar);
|
|
|
|
/**
|
|
* Enforce self parameters to be compatible with those exposed by the selected StateTree asset.
|
|
*/
|
|
void SyncParameters() { SyncParameters(Parameters); }
|
|
|
|
/**
|
|
* Sync provided parameters to be compatible with those exposed by the selected StateTree asset.
|
|
*/
|
|
void SyncParameters(FInstancedPropertyBag& ParametersToSync) const;
|
|
|
|
/**
|
|
* Indicates if current parameters are compatible with those available in the selected StateTree asset.
|
|
* @return true when parameters requires to be synced to be compatible with those available in the selected StateTree asset, false otherwise.
|
|
*/
|
|
bool RequiresParametersSync() const;
|
|
|
|
private:
|
|
FDelegateHandle PIEHandle;
|
|
#endif
|
|
};
|
|
|
|
#if WITH_EDITORONLY_DATA
|
|
template<>
|
|
struct TStructOpsTypeTraits<FStateTreeReference> : public TStructOpsTypeTraitsBase2<FStateTreeReference>
|
|
{
|
|
enum
|
|
{
|
|
WithPostSerialize = true,
|
|
};
|
|
};
|
|
#endif
|