static BuildPipelineExecutor() { PlayerSettingsSnapshot.ApplySnapshot(); QuickUnityEditorEventsWatcher watcher = QuickUnityEditorEventsWatcher.Observe(); watcher.BuildPipeline.OnProcessScene.AddListener(onProcessScene); watcher.BuildPipeline.OnPreprocessBuild.AddListener(onPreprocessBuild); watcher.BuildPipeline.OnPostprocessBuild.AddListener(onPostprocessBuild); }
private static void PreBuild(BuildEnvsOptions buildOptions) { if (UnityEditor.BuildPipeline.isBuildingPlayer) { return; } PlayerSettingsSnapshot.ApplySnapshotIfFailed(() => { PlayerSettingsSnapshot.TakeSnapshot(); BuildPipelineExecutor.DefaultBuildEnvsOptions.ApplySettings(); bool valid = BuildPipelineValidator.IsValid(buildOptions.targetGroup); if (!valid) { //Debug.LogError("Build failure with errors"); throw new BuildFailedException("Build failure with errors"); } int code = BuildPlayer(buildOptions, false); if (CommandLineArgs.InBatchMode()) { EditorApplication.Exit(code); } }); }
private static void onPostprocessBuild(BuildTarget target, string pathToBuildProject) { Debug.Log("Starting to perform Postprocess build tasks for {0} platform.", target); PlayerSettingsSnapshot.ApplySnapshot(); }