public static HeadlessRoutine start(IEnumerator _routine) { HeadlessRoutine coroutine = new HeadlessRoutine(_routine); coroutine.start(); return(coroutine); }
// This function overarches the entire build process private static void Build () { buildError = false; if (batchBuild) { // Process the relevant command line arguments string[] args = System.Environment.GetCommandLineArgs (); string batchPath = null; string batchProfile = null; for (int i = 0; i < args.Length - 1; i++) { if (args [i] == "-headlessPath") { batchPath = args [i + 1]; } if (args [i] == "-headlessProfile") { batchProfile = args [i + 1]; } } if (batchPath != null && Directory.Exists (batchPath)) { buildPath = batchPath; } else { UnityEngine.Debug.LogError ("Use the -headlessPath command line parameter to set a valid destination path for the headless build\nHeadless Builder (v" + Headless.version + ")"); return; } if (batchProfile != null) { bool found = false; HeadlessProfiles.FindProfiles (); foreach (KeyValuePair<string,string> profile in HeadlessProfiles.GetProfileList()) { if (profile.Value.Equals (batchProfile)) { found = true; HeadlessProfiles.SetProfile (profile.Key); } } if (!found) { UnityEngine.Debug.LogError ("The profile specified by the -headlessProfile command line parameter was not found\nHeadless Builder (v" + Headless.version + ")"); return; } } } if (manualBuild || debugBuild) { if (!EditorWindow.GetWindow<HeadlessEditor>().IsDocked()) { EditorWindow.GetWindow<HeadlessEditor>().Close(); } } // Load the settings (from file, not from memory) PrepareVariables(); Headless.SetBuildingHeadless (true, headlessSettings.profileName); bool asyncExecute = manualBuild || debugBuild; if (asyncExecute) { HeadlessRoutine.start (InnerBuildAsync ()); } else { InnerBuildSync (); } }