Fix synchronizing nested prefabs when adding new ObjectsLookupIdMapping

#351
This commit is contained in:
Wojtek Figat
2021-03-18 00:04:58 +01:00
parent df497bf684
commit 42366ee66a
5 changed files with 50 additions and 9 deletions

View File

@@ -1037,9 +1037,7 @@ bool Level::loadScene(rapidjson_flax::Value& data, int32 engineBuild, bool autoI
// Synchronize prefab instances (prefab may have new objects added or some removed so deserialized instances need to synchronize with it)
// TODO: resave and force sync scenes during game cooking so this step could be skipped in game
Scripting::ObjectsLookupIdMapping.Set(&modifier.Value->IdsMapping);
SceneObjectsFactory::SynchronizePrefabInstances(*sceneObjects.Value, actorToRemovedObjectsData, modifier.Value);
Scripting::ObjectsLookupIdMapping.Set(nullptr);
// Delete objects without parent
for (int32 i = 1; i < objectsCount; i++)