Creating a build system
We have learned how to export a build in the Editor using the Build Settings window. Now, we are going to see how to automate this process by creating a new BuildSystem
script, which will use similar options to export the build through the UnityEditor
API in the code instead of the Build Settings window.
Create a new script in the Scripts | Editor folder, name it BuildSystem
, and replace the content with the following code block:
#if UNITY_EDITOR using UnityEditor.Build.Reporting; using UnityEditor; using UnityEngine; namespace Dragoncraft { public static class BuildSystem { private static string[] _releaseScenes = new[] { "Assets/Scenes/Level01.unity", "Assets/Scenes/GameUI.unity" }; private static string[] _debugScenes = new[] { ...