There is nill documentation on EditorBuildSettings.scenes. Does it return an array of all the scenes in the build settings window, or just the ones that have the checkboxes?
If it returns all the scenes, is there a way to test if they are checkboxed true?
I’ve figured it out. It returns an array of all the scenes in the build settings window.
You can get just the enabled scenes like so:
List<EditorBuildSettingsScene> scenes = new List<EditorBuildSettingsScene>(EditorBuildSettings.scenes);
List<string> enabledScenes = new List<string>();
foreach (EditorBuildSettingsScene scene in scenes)
{
if (scene.enabled)
{
enabledScenes.Add(scene.path);
}
}
In case you want to use Linq:
string[] scenes = (from scene in EditorBuildSettings.scenes
where scene.enabled select scene.path).ToArray();