Quick code snippet to grab all scene names in a project: –

public List<string> scenes;

int sceneCount = UnityEngine.SceneManagement.SceneManager.sceneCountInBuildSettings;
for (int i = 0; i < sceneCount; i++)
{
  string sceneName = System.IO.Path.GetFileNameWithoutExtension(UnityEngine.SceneManagement.SceneUtility.GetScenePathByBuildIndex(i));
  scenes.Add(sceneName);
  Debug.Log("Scene: " + sceneName);
}

 

 

 

Advertisements