clear sceneid if it was a duplicate

This commit is contained in:
vis2k 2019-04-14 12:40:16 +02:00
parent 3ebd4981a4
commit f3f0ef299e

View File

@ -274,6 +274,9 @@ void AssignSceneID()
bool duplicate = sceneIds.TryGetValue(m_SceneId, out existing) && existing != null && existing != this; bool duplicate = sceneIds.TryGetValue(m_SceneId, out existing) && existing != null && existing != this;
if (m_SceneId == 0 || duplicate) if (m_SceneId == 0 || duplicate)
{ {
// clear in any case, because it might have been a duplicate
m_SceneId = 0;
// if a scene was never opened and we are building it, then a // if a scene was never opened and we are building it, then a
// sceneId would be assigned to build but not saved in editor, // sceneId would be assigned to build but not saved in editor,
// resulting in them getting out of sync. // resulting in them getting out of sync.