孟宇 hace 5 meses
padre
commit
9356534441

+ 4 - 0
Ability/Plugins/EzAbility/EzAbility.uplugin

@@ -35,6 +35,10 @@
 		{
 			"Name": "StructUtils",
 			"Enabled": true
+		},
+		{
+			"Name": "PropertyAccessEditor",
+			"Enabled": true
 		}
 	]
 }

+ 37 - 0
Ability/Plugins/EzAbility/Source/EzAbilityTest/Private/EzAbilityTest.cpp

@@ -10,6 +10,7 @@
 #include "EzAbilityComponent.h"
 #include "EzAbilityEditorData.h"
 #include "EzAblityTestTypes.h"
+#include "GameplayTagsManager.h"
 
 #include UE_INLINE_GENERATED_CPP_BY_NAME(EzAbilityTest)
 
@@ -29,6 +30,42 @@ namespace UE::EzAbility::Tests
 		EditorData->Schema = NewObject<UEzAbilityTestSchema>();
 		return *Ability;
 	}
+
+	FEzAbilityPropertyPathBinding MakeBinding(const FGuid& SourceID, const FString& Source, const FGuid& TargetID, const FString& Target)
+	{
+		FEzAbilityPropertyPath SourcePath;
+		SourcePath.FromString(Source);
+		SourcePath.SetStructID(SourceID);
+
+		FEzAbilityPropertyPath TargetPath;
+		TargetPath.FromString(Target);
+		TargetPath.SetStructID(TargetID);
+
+		return FEzAbilityPropertyPathBinding(SourcePath, TargetPath);
+	}
+
+	// Helper struct to define some test tags
+	struct FNativeGameplayTags : public FGameplayTagNativeAdder
+	{
+		virtual ~FNativeGameplayTags() {}
+		
+		FGameplayTag TestTag;
+		FGameplayTag TestTag2;
+
+		virtual void AddTags() override
+		{
+			UGameplayTagsManager& Manager = UGameplayTagsManager::Get();
+			TestTag = Manager.AddNativeGameplayTag(TEXT("Test.StateTree.Tag"));
+			TestTag2 = Manager.AddNativeGameplayTag(TEXT("Test.StateTree.Tag2"));
+		}
+
+		FORCEINLINE static const FNativeGameplayTags& Get()
+		{
+			return StaticInstance;
+		}
+		static FNativeGameplayTags StaticInstance;
+	};
+	FNativeGameplayTags FNativeGameplayTags::StaticInstance;
 }
 
 //////////////////////////////////////////////////////////////////////////////////////////////////////////