Question by
Barsonax · Nov 24, 2016 at 10:39 AM ·
scene-loadingscenes
Bug in scenemanager when using GetSceneAt??
The following code is giving me a out of range exception:
public static IEnumerable<Scene> GetAllScenes()
{
for (int i = 0; i < SceneManager.sceneCountInBuildSettings; i++)
{
yield return SceneManager.GetSceneAt(i);
}
}
I have 2 scenes added to the build settings yet when i do SceneManager.GetSceneAt(1) it throws a out of range exception. Where did my second scene go?
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612101314im_/https://answers.unity.com/themes/thub/images/avi.jpg)