Unity-Resource-Checker
Unity-Resource-Checker copied to clipboard
Multiple Scenes in Hierarchy with only one loaded throws "scene not loaded"
When multiple scenes are in the Hierarchy the Checker will throw a "scene not loaded exception". This occurs regardless of whether or not they are listed in your Build Settings.
The issue is at line 957. A check needs to be made to determine if the Scene is loaded or not. Change the for loop to...
for (int sceneIdx = 0; sceneIdx < UnityEngine.SceneManagement.SceneManager.sceneCount; ++sceneIdx){
Scene scene = UnityEngine.SceneManagement.SceneManager.GetSceneAt(sceneIdx);
if (scene.isLoaded)
{
allGo.AddRange(scene.GetRootGameObjects());
}
}
There were also too many ToArray()
calls.