Skip to content

Commit 102bee4

Browse files
authored
Merge pull request #75 from Zenodeon/SceneSerializationUtility-Deleted-Scene-Check
Update SceneSerializationUtility.cs
2 parents 06742b1 + 4ad5149 commit 102bee4

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

Assets/Editor Toolbox/Runtime/Serialization/SceneSerializationUtility.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,13 @@ private static void RefreshCache()
4343
var buildIndex = -1;
4444
foreach (var scene in EditorBuildSettings.scenes)
4545
{
46+
if (string.IsNullOrEmpty(scene.path))
47+
{
48+
continue;
49+
}
50+
4651
buildIndex++;
52+
4753
var sceneIndex = scene.enabled ? buildIndex : InvalidSceneIndex;
4854
var sceneAsset = EditorGUIUtility.Load(scene.path) as SceneAsset;
4955
if (sceneAsset != null)
@@ -80,4 +86,4 @@ public static bool TryGetSceneData(SceneAsset sceneAsset, out SceneData data)
8086

8187
public static int InvalidSceneIndex => -1;
8288
}
83-
}
89+
}

0 commit comments

Comments
 (0)