- Home /
Modify "Builds Settings/Scenes to Build" in Script
We have a custom publishing script that uses UnityEditor.BuildPipeline, however when testing in the editor Application.LoadLevel() fails because we don't use the human-driven build settings menu. I'd like to write an editor script which automatically syncs those settings with our build script to avoid this, but there aren't any methods in the UnityEditor API for doing this... or am I missing something?
Answer by Ben 2 · May 04, 2010 at 08:45 PM
If I understand you correctly you want to read the values that are displayed in the Build Settings dialog. I too had this question before and there is no apparent way to read from the build settings asset file. So you're not missing anything, its simply not there.
Answer by SpiralConDave · Sep 26, 2017 at 10:24 PM
I know this is an old Q&A, but there is now an API for that, see https://docs.unity3d.com/ScriptReference/EditorUserBuildSettings.html
Your answer
Follow this Question
Related Questions
Add/Remove scene to build settings from editor script and run levels in editor 0 Answers
Getting the current BuildOptions 1 Answer
How to automatically edit and build a project by script? 0 Answers
Set dynamicBatching player setting via editor script? 0 Answers
Is there a some sort of OnBuild() event for the editor? 1 Answer