Fixed issue, where scenes could be valid, but not loaded and still crash Unity Editor when accessing path
This commit is contained in:
parent
d34a50767b
commit
230a976a52
4 changed files with 16 additions and 4 deletions
|
|
@ -2,6 +2,7 @@
|
|||
using System.IO;
|
||||
using System.Linq;
|
||||
using UnityEditor;
|
||||
using UnityEditor.SceneManagement;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
|
|
@ -248,7 +249,9 @@ namespace Module.NavigationTool.Editor.Toolbar
|
|||
{
|
||||
Scene scene = SceneManager.GetSceneAt(i);
|
||||
|
||||
if (!scene.IsValid() || string.IsNullOrEmpty(scene.path))
|
||||
if (!scene.IsValid() || !scene.isLoaded)
|
||||
continue;
|
||||
if (string.IsNullOrEmpty(scene.path))
|
||||
continue;
|
||||
|
||||
int index = IndexOfPath(scenes, scene.path, false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue