Release Prefab assets when reloading Scripting service

This commit is contained in:
2024-04-21 13:59:59 +03:00
parent b958ecc64f
commit d70aa20a7a

View File

@@ -32,6 +32,7 @@
#include "Engine/Graphics/RenderTask.h"
#include "Engine/Serialization/JsonTools.h"
#include "Engine/Profiler/ProfilerCPU.h"
#include "Engine/Level/Prefabs/Prefab.h"
extern void registerFlaxEngineInternalCalls();
@@ -141,7 +142,10 @@ namespace
{
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();