Browse Source

[ue] Closes #2728, adhere to new API in UE 5.4+

Mario Zechner 5 months ago
parent
commit
ed0206dde3

+ 9 - 0
spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonDataAsset.cpp

@@ -70,6 +70,14 @@ void USpineSkeletonDataAsset::PostInitProperties() {
 	Super::PostInitProperties();
 }
 
+#if ((ENGINE_MAJOR_VERSION >= 5) && (ENGINE_MINOR_VERSION >= 4))
+void USpineSkeletonDataAsset::GetAssetRegistryTags(FAssetRegistryTagsContext Context) const {
+	if (importData) {
+		Context.AddTag(FAssetRegistryTag(SourceFileTagName(), importData->GetSourceData().ToJson(), FAssetRegistryTag::TT_Hidden));
+	}
+	Super::GetAssetRegistryTags(Context);
+}
+#else
 void USpineSkeletonDataAsset::GetAssetRegistryTags(
 		TArray<FAssetRegistryTag> &OutTags) const {
 	if (importData) {
@@ -80,6 +88,7 @@ void USpineSkeletonDataAsset::GetAssetRegistryTags(
 
 	Super::GetAssetRegistryTags(OutTags);
 }
+#endif
 
 void USpineSkeletonDataAsset::Serialize(FArchive &Ar) {
 	Super::Serialize(Ar);

+ 6 - 2
spine-ue/Plugins/SpinePlugin/Source/SpinePlugin/Public/SpineSkeletonDataAsset.h

@@ -114,8 +114,12 @@ protected:
 	class UAssetImportData *importData = nullptr;
 
 	virtual void PostInitProperties() override;
-	virtual void
-	GetAssetRegistryTags(TArray<FAssetRegistryTag> &OutTags) const override;
+#if ((ENGINE_MAJOR_VERSION >= 5) && (ENGINE_MINOR_VERSION >= 4))
+	virtual void GetAssetRegistryTags(FAssetRegistryTagsContext Context) const override;
+#else
+	virtual void GetAssetRegistryTags(TArray<FAssetRegistryTag> &OutTags) const override;
+#endif
+
 	virtual void Serialize(FArchive &Ar) override;
 #endif