_prefab unloadfix
This commit is contained in:
@@ -166,6 +166,7 @@ Asset::LoadResult Prefab::loadAsset()
|
|||||||
#if USE_EDITOR
|
#if USE_EDITOR
|
||||||
Scripting::ScriptsReloading.Bind<Prefab, &Prefab::DeleteDefaultInstance>(this);
|
Scripting::ScriptsReloading.Bind<Prefab, &Prefab::DeleteDefaultInstance>(this);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
return LoadResult::Ok;
|
return LoadResult::Ok;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -141,12 +141,7 @@ namespace
|
|||||||
for (auto asset : assets)
|
for (auto asset : assets)
|
||||||
{
|
{
|
||||||
if (asset->GetTypeHandle().Module == flaxModule)
|
if (asset->GetTypeHandle().Module == flaxModule)
|
||||||
{
|
continue;
|
||||||
// Release also prefabs as those might contain scene objects using assets from other assemblies
|
|
||||||
Prefab* prefab = dynamic_cast<Prefab*>(asset);
|
|
||||||
if (prefab == nullptr)
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
asset->DeleteObject();
|
asset->DeleteObject();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user