示例#1
0
        public BuildProcess GetCurrentBuildProcess()
        {
            UBSProcess   ubs     = UBSProcess.LoadUBSProcess();
            BuildProcess process = ubs.GetCurrentProcess();

            return(process);
        }
示例#2
0
        protected override void OnGUI()
        {
            base.OnGUI();

            if (!mInit)
            {
                Initialize();
            }

            if (mEmpty)
            {
                // still no process existing?
                GUILayout.Label("Nothing to build", Styles.bigHint);
                return;
            }

            GUILayout.BeginArea(new Rect(25, 25, 300, 20));
            {
                GUILayout.BeginHorizontal();
                {
                    GUILayout.Label("Build Processes", "BoldLabel");
                    GUILayout.FlexibleSpace();

                    if (GUILayout.Button("Select Build Collection"))
                    {
                        Selection.activeObject = mProcess.BuildCollection;
                    }
                }
                GUILayout.EndHorizontal();
            }
            GUILayout.EndArea();

            GUILayout.BeginArea(new Rect(25, 50, 300, 125), EditorStyles.helpBox);
            {
                scrollPosition01 = GUILayout.BeginScrollView(scrollPosition01);
                {
                    GUILayout.BeginVertical();
                    {
                        for (int i = 0; i < mProcess.BuildCollection.mProcesses.Count; i++)
                        {
                            var  p   = mProcess.BuildCollection.mProcesses[i];
                            bool odd = (i % 2) == 0;

                            GUI.enabled = p.mSelected;
                            UBSWindowBase.DrawBuildProcessEntry(mProcess.BuildCollection, p, odd, 0, false);
                        }
                        GUI.enabled = true;
                    }
                    GUILayout.EndVertical();
                }
                GUILayout.EndScrollView();
            }
            GUILayout.EndArea();

            GUI.Box(new Rect(25, 205, 300, 230), "", EditorStyles.helpBox);


            float fTop  = 205;
            float fLeft = 30;

            GUI.BeginGroup(new Rect(fLeft, fTop, 300, kHeight));
            KeyValue("Collection:", mProcess.BuildCollection.name);
            GUI.EndGroup();

            fTop += kHeight;
            GUI.BeginGroup(new Rect(fLeft, fTop, 300, kHeight));
            KeyValue("CurrentProcess: ", mProcess.CurrentProcessName);
            GUI.EndGroup();

            fTop += kHeight;
            GUI.BeginGroup(new Rect(fLeft, fTop, 300, kHeight));
            KeyValue("CurrentState: ", mProcess.CurrentState);
            GUI.EndGroup();


            fTop += kHeight;
            GUI.BeginGroup(new Rect(fLeft, fTop, 300, kHeight));
            KeyProgress("Pre Steps Progress: ", mProcess.SubPreWalker.Progress);
            GUI.EndGroup();

            fTop += kHeight;
            GUI.BeginGroup(new Rect(fLeft, fTop, 300, kHeight));
            KeyValue("Pre Step Current: ", mProcess.SubPreWalker.Step);
            GUI.EndGroup();

            fTop += kHeight;
            GUI.BeginGroup(new Rect(fLeft, fTop, 300, kHeight));
            KeyProgress("Post Steps Progress: ", mProcess.SubPostWalker.Progress);
            GUI.EndGroup();

            fTop += kHeight;
            GUI.BeginGroup(new Rect(fLeft, fTop, 300, kHeight));
            KeyValue("Post Step Current: ", mProcess.SubPostWalker.Step);
            GUI.EndGroup();

            fTop += kHeight;
            GUI.BeginGroup(new Rect(fLeft, fTop, 300, kHeight));
            KeyProgress("Progress: ", mProcess.Progress);
            GUI.EndGroup();

            fTop += kHeight;
            GUILayout.BeginArea(new Rect(fLeft, fTop, 290, kHeight * 5));

            GUILayout.Space(5);
            if (UBSProcess.BuildBehavior == UBSBuildBehavior.manual && mProcess.CurrentState == UBSState.building)
            {
                GUILayout.BeginVertical();
                EditorGUILayout.HelpBox("You use Unity free. Open build settings and press \"Build\" manually. ", MessageType.Info);
                EditorGUILayout.HelpBox("Output path: " + mProcess.GetCurrentProcess().mOutputPath, MessageType.Info);

                if (GUILayout.Button("Open Build Settings"))
                {
                    System.Reflection.Assembly asm = System.Reflection.Assembly.GetAssembly(typeof(EditorWindow));
                    var M = asm
                            .GetType("UnityEditor.BuildPlayerWindow")
                            .GetMethod("ShowBuildPlayerWindow", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static);
                    M.Invoke(null, null);
                }
                GUILayout.EndVertical();
            }
            else
            {
                GUI.enabled = !mProcess.IsDone;
                if (GUILayout.Button("Cancel"))
                {
                    mProcess.Cancel();
                }
            }


            GUILayout.EndArea();
        }
示例#3
0
        protected override void OnGUI()
        {
            base.OnGUI();

            if (!mInit)
            {
                Initialize();
            }

            if (mEmpty)
            {
                // still no process existing?
                GUILayout.Label("Nothing to build", Styles.bigHint);
                return;
            }

            GUI.Box(new Rect(25, 25, 300, 310), "", Styles.buildProcessEditorBackground);


            float fTop  = 25;
            float fLeft = 30;

            GUI.BeginGroup(new Rect(fLeft, fTop, 300, kHeight));
            KeyValue("Collection:", mProcess.BuildCollection.name);
            GUI.EndGroup();

            fTop += kHeight;
            GUI.BeginGroup(new Rect(fLeft, fTop, 300, kHeight));
            KeyValue("CurrentProcess: ", mProcess.CurrentProcessName);
            GUI.EndGroup();

            fTop += kHeight;
            GUI.BeginGroup(new Rect(fLeft, fTop, 300, kHeight));
            KeyValue("CurrentState: ", mProcess.CurrentState);
            GUI.EndGroup();


            fTop += kHeight;
            GUI.BeginGroup(new Rect(fLeft, fTop, 300, kHeight));
            KeyProgress("Pre Steps Progress: ", mProcess.SubPreWalker.Progress);
            GUI.EndGroup();

            fTop += kHeight;
            GUI.BeginGroup(new Rect(fLeft, fTop, 300, kHeight));
            KeyValue("Pre Step Current: ", mProcess.SubPreWalker.Step);
            GUI.EndGroup();

            fTop += kHeight;
            GUI.BeginGroup(new Rect(fLeft, fTop, 300, kHeight));
            KeyProgress("Post Steps Progress: ", mProcess.SubPostWalker.Progress);
            GUI.EndGroup();

            fTop += kHeight;
            GUI.BeginGroup(new Rect(fLeft, fTop, 300, kHeight));
            KeyValue("Post Step Current: ", mProcess.SubPostWalker.Step);
            GUI.EndGroup();

            fTop += kHeight;
            GUI.BeginGroup(new Rect(fLeft, fTop, 300, kHeight));
            KeyProgress("Progress: ", mProcess.Progress);
            GUI.EndGroup();

            fTop += kHeight;
            GUILayout.BeginArea(new Rect(fLeft, fTop, 290, kHeight * 5));
            if (UBSProcess.BuildBehavior == UBSBuildBehavior.manual && mProcess.CurrentState == UBSState.building)
            {
                GUILayout.BeginVertical();
                EditorGUILayout.HelpBox("You use Unity free. Open build settings and press \"Build\" manually. ", MessageType.Info);
                EditorGUILayout.HelpBox("Output path: " + mProcess.GetCurrentProcess().mOutputPath, MessageType.Info);

                if (GUILayout.Button("Open Build Settings"))
                {
                    System.Reflection.Assembly asm = System.Reflection.Assembly.GetAssembly(typeof(EditorWindow));
                    var M = asm
                            .GetType("UnityEditor.BuildPlayerWindow")
                            .GetMethod("ShowBuildPlayerWindow", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static);
                    M.Invoke(null, null);
                }
                GUILayout.EndVertical();
            }
            else
            {
                if (GUILayout.Button("Cancel"))
                {
                    mProcess.Cancel();
                }
            }
            GUILayout.EndArea();
        }