public static string BuildPlayer(EditorBuildSettingsScene[] levels, string locationPathName, BuildTarget target, BuildOptions options) { return(BuildPipeline.BuildPlayer(new BuildPlayerOptions { scenes = EditorBuildSettingsScene.GetActiveSceneList(levels), locationPathName = locationPathName, target = target, options = options })); }
public static BuildReport BuildPlayer(EditorBuildSettingsScene[] levels, string locationPathName, BuildTarget target, BuildOptions options) { BuildPlayerOptions buildPlayerOptions = new BuildPlayerOptions(); buildPlayerOptions.scenes = EditorBuildSettingsScene.GetActiveSceneList(levels); buildPlayerOptions.locationPathName = locationPathName; buildPlayerOptions.target = target; buildPlayerOptions.options = options; return(BuildPlayer(buildPlayerOptions)); }
protected static void OpenMainScene() { string[] scenes = EditorBuildSettingsScene.GetActiveSceneList(EditorBuildSettings.scenes); string main = scenes.Length > 0 ? scenes[0] : string.Empty; Scene current = EditorSceneManager.GetActiveScene(); if (!string.IsNullOrEmpty(main) && current.path != main) { EditorSceneManager.OpenScene(main); } EditorApplication.isPlaying = true; }