Hey,
Trying to Load and Unload assets at runtime. When loading I register the assets with the asset registry using IAssetRegistry::ScanPathsSynchronous. When unloading the assets I need to get them out of the asset registry. The only way to do so seems to be IAssetRegistry::AssetDeleted, but that crashes in a packaged game cause of a checkf
UMetaData* UPackage::GetMetaData()
{
checkf(!FPlatformProperties::RequiresCookedData(), TEXT("MetaData is only allowed in the Editor."));
#if WITH_EDITORONLY_DATA
...
#else
return nullptr;
#endif
}
The check is completely useless in a packaged game as the function returns a nullptr in packaged game anyway.
Change the code to:
UMetaData* UPackage::GetMetaData()
{
#if WITH_EDITORONLY_DATA
checkf(!FPlatformProperties::RequiresCookedData(), TEXT("MetaData is only allowed in the Editor."));
...
#else
return nullptr;
#endif
}
or just remove it completely