Esempio n. 1
0
 public void     StartNewProcess(string buildPath, QBProfile editorProfile, QBPlayerSettings playerSettings, int numProcess = 1)
 {
     for (int processIndex = 0; processIndex < numProcess; ++processIndex)
     {
         StartNewSoloProcess(buildPath, editorProfile, playerSettings, processIndex);
     }
 }
Esempio n. 2
0
        public bool     BuildAndPlayCurrentScenes(QBProfile profile)
        {
            string[] scenes = GetSceneNames();

            DumpScenesToBuild();

            if (scenes.Length > 0)
            {
                string path = profile.ExecutablePath;
                ThrowIfBuildPathInvalid(path);

                using (new QBBuildSettingsPreserveContext())
                {
                    PlayerSettings.runInBackground         = true;
                    PlayerSettings.displayResolutionDialog = ResolutionDialogSetting.HiddenByDefault;

                    EditorBuildSettings.scenes = GetEditorBuildSettingsScenes();
                    BuildPlayerOptions buildPlayerOptions = GetBuildPlayerOptions(profile, path, scenes);

                    Profiler.BeginSample("Quick Build - Build operation");
                    string result = BuildPipeline.BuildPlayer(buildPlayerOptions);
                    Profiler.EndSample();

                    return(string.IsNullOrEmpty(result));
                }
            }

            return(false);
        }
Esempio n. 3
0
        void StartNewSoloProcess(string BuildPath, QBProfile editorSettings, QBPlayerSettings PlayerSettings, int ProcessID)
        {
            QBProcess process = new QBProcess(BuildPath, editorSettings, PlayerSettings, ProcessID);

            process.OnProcessCompleted += HandleProcessCompleted;;
            _processes.Add(process);
            process.Start();
        }
Esempio n. 4
0
        public QBProcess(string buildPath, QBProfile editorProfile, QBPlayerSettings playerSettings, int instanceID)
        {
            _instanceID = instanceID;
            _profile    = editorProfile;

            _processStartInfo = new ProcessStartInfo();
            //_processStartInfo.UseShellExecute = false;
            _processStartInfo.WindowStyle = ProcessWindowStyle.Normal;
//			processStartInfo.RedirectStandardOutput = EditorSettings.RedirectOutputLog;
            _processStartInfo.FileName  = buildPath;
            _processStartInfo.Arguments = BuildCommandLineArguments(editorProfile, playerSettings, instanceID);

            UnityEngine.Debug.Log("Command line arguments : " + _processStartInfo.Arguments);
        }
Esempio n. 5
0
        private void DrawQBProfile()
        {
            profile = (QBProfile)EditorGUILayout.ObjectField(profile, typeof(QBProfile), false);

            if (profile != null)
            {
                SerializedObject serializedProfile = new SerializedObject(profile);

                SerializedProperty props = serializedProfile.GetIterator();
                props.NextVisible(true);
                while (props.NextVisible(false))
                {
                    EditorGUILayout.PropertyField(props, true);
                }

                if (serializedProfile.ApplyModifiedProperties())
                {
                    serializedProfile.UpdateIfRequiredOrScript();
                }
            }
        }
Esempio n. 6
0
        BuildPlayerOptions      GetBuildPlayerOptions(QBProfile profile, string buildPath, string[] sceneNames)
        {
            BuildPlayerOptions buildPlayerOptions = new BuildPlayerOptions()
            {
                locationPathName = buildPath,
                scenes           = sceneNames,
                options          = BuildOptions.UncompressedAssetBundle,
                target           = EditorUserBuildSettings.selectedStandaloneTarget,
                targetGroup      = EditorUserBuildSettings.selectedBuildTargetGroup
            };

            if (profile.expertSettings.allowDebugging)
            {
                buildPlayerOptions.options |= BuildOptions.Development | BuildOptions.AllowDebugging;
            }

            if (profile.buildScriptsOnly)
            {
                buildPlayerOptions.options |= BuildOptions.Development | BuildOptions.BuildScriptsOnly;
            }

            return(buildPlayerOptions);
        }
Esempio n. 7
0
 public void     RunBuilds(QBProfile profile)
 {
     processes.StartNewProcess(profile.ExecutablePath, profile, GeneratePlayerSettings(), profile.numberOfInstances);
 }
Esempio n. 8
0
        private string  BuildCommandLineArguments(QBProfile editorProfile, QBPlayerSettings playerSettings, int instanceID)
        {
            StringBuilder sb = new StringBuilder();

            AddCommandLineArgument(sb, QBCommandLineParameters.EnableQuickBuild);
            AddCommandLineArgument(sb, QBCommandLineParameters.InstanceID, instanceID);

            AddCommandLineArgument(sb, QBCommandLineParameters.Screen_FullscreenMode, editorProfile.advancedSettings.screenSettings.isFullScreen ? 1 : 0);

            int width, height;

            editorProfile.GetScreenSizeForInstance(instanceID, out width, out height);
            AddCommandLineArgument(sb, QBCommandLineParameters.Screen_Width, width);
            AddCommandLineArgument(sb, QBCommandLineParameters.Screen_Height, height);

            string outputLogFileName = string.Empty;

            if (!editorProfile.advancedSettings.redirectOutputLog)
            {
                outputLogFileName = editorProfile.BuildDirectoryPath + "/" + string.Format(QBCommandLineParameters.LogFileFormat, instanceID);
                AddCommandLineArgument(sb, QBCommandLineParameters.LogFile, outputLogFileName);
            }
            else
            {
                AddCommandLineArgument(sb, QBCommandLineParameters.RedirectOutput);
            }

            if (editorProfile.expertSettings.launchInBatchMode)
            {
                AddCommandLineArgument(sb, QBCommandLineParameters.Batchmode);
                AddCommandLineArgument(sb, QBCommandLineParameters.NoGraphics);
            }

            if (editorProfile.advancedSettings.displayInstanceID)
            {
                AddCommandLineArgument(sb, QBCommandLineParameters.DisplayInstanceID);
            }


            if (playerSettings.AdditiveScenes.Length > 0)
            {
                AddCommandLineArgument(sb, QBCommandLineParameters.AdditiveScenes, QBCommandLineHelper.PackStringArray(playerSettings.AdditiveScenes));
            }

            if (instanceID < editorProfile.expertSettings.customInstanceDatas.Length)
            {
                QBInstanceData qbInstanceData = editorProfile.expertSettings.customInstanceDatas[instanceID];
                if (qbInstanceData)
                {
                    AddCommandLineArgument(sb, qbInstanceData.commandLineArguments);

                    if (!string.IsNullOrEmpty(qbInstanceData.customName))
                    {
                        AddCommandLineArgument(sb, QBCommandLineParameters.CustomName, qbInstanceData.customName);
                    }
                }
            }

            AddCommandLineArgument(sb, editorProfile.advancedSettings.commandLineArguments);
            return(sb.ToString());
        }