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

This commit is contained in:
Mario Zechner 2025-04-17 14:12:35 +02:00
parent ddfa736ae2
commit ed0206dde3
2 changed files with 15 additions and 2 deletions

View File

@ -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);

View File

@ -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