void IFXToolsQualityCheckToolUI()
        {
            Rect groupRect = new Rect(5, 25, Screen.width - 20, Screen.height - 10);

            scrollPos = EditorGUILayout.BeginScrollView(scrollPos, GUILayout.Width(groupRect.width), GUILayout.Height(groupRect.height - 175));
            foreach (QACheckListItem item in checkList)
            {
                GUILayout.BeginVertical(EditorStyles.helpBox);
                EditorGUILayout.LabelField("Name: " + item.rootGameObject.name, EditorStyles.boldLabel);
                foreach (string error in item.errors)
                {
                    GUILayout.Label("Errors: " + error);
                }
                if (GUILayout.Button("open prefab"))
                {
                    AssetDatabase.OpenAsset(item.rootGameObject);
                    this.Close();
                }
                if (GUILayout.Button("Auto Fix prefab"))
                {
                    IFXToolSM.FixPrefabs(item.rootGameObject);
                }
                GUILayout.EndVertical();
                GUILayout.Label(" ");
            }

            GUILayout.Label(" ");
            GUILayout.Label(" ");
            EditorGUILayout.EndScrollView();

            if (GUI.Button(new Rect(10, groupRect.height - 175, groupRect.width, 50), "Recheck Bundle"))
            {
                BundleQualityCheck(buildSettingsStored);
            }

            if (GUI.Button(new Rect(10, groupRect.height - 125, groupRect.width, 50), "Ignore Remaining Issues"))
            {
                buildSettingsStored.buildQACheckOverride = true;
                bundleTool.BuildSelectedBundle(buildSettingsStored);
                this.Close();
            }

            if (GUI.Button(new Rect(10, groupRect.height - 75, groupRect.width, 50), "Cancel"))
            {
                this.Close();
            }
        }
Ejemplo n.º 2
0
        void BuildSelectedBundleWindowUI()
        {
            if (bundleTools.buildingStatus != null)
            {
                GUIStyle buildstatusStyle = new GUIStyle();
                buildstatusStyle.fontSize         = 45;
                buildstatusStyle.normal.textColor = Color.red;
                GUI.Label(new Rect(20, Screen.height / 2, 300, 50), bundleTools.buildingStatus, buildstatusStyle);
                //EditorGUILayout.LabelField(bundleTools.buildingStatus);//Building Status.
            }


            QuickToolsHelp.BuildBundlesInstructions(); // displays the instructions for this tool

            //with qa check disabled it will skip the whole qa process. sometimes qeird components or things like that can trip it up so I left the option to skip it.
            buildQACheckOverride = EditorGUILayout.Toggle("Disable Quality Check", buildQACheckOverride);

            //ct mode dsiables the git stuff
            if (userSettings.CTMode())
            {
                autoGitYesNo = EditorGUILayout.Toggle("Push Bundles To CDN?", autoGitYesNo);
                gitCommitM   = EditorGUILayout.TextField("Git Commit message: ", gitCommitM);

                if (GUILayout.Button("Push changes in folder to git"))
                {
                    if (gitCommitM == "")
                    {
                        EditorUtility.DisplayDialog("WARNING!", "To auto push you need to enter a commit message", "OK", "Cancel");
                    }
                    else
                    {
                        bundleTools.GitCommitChangesToRepo(IFXToolSM.GetSelectedObjectsAsList(), gitCommitM);
                    }
                }
            }


            windowsBuildYesNo = EditorGUILayout.Toggle("Build for Windows?", windowsBuildYesNo);
            androidBuildYesNo = EditorGUILayout.Toggle("Build for Android?", androidBuildYesNo);
            iOSBuildYesNo     = EditorGUILayout.Toggle("Build for iOS?", iOSBuildYesNo);

            //CheckList
            QuickToolsHelp.PreBuildChecklist(); // displays the instructions for this tool

            if (GUILayout.Button("AssetBundle From Selection"))
            {
                if (autoGitYesNo == true && gitCommitM == "")
                {
                    EditorUtility.DisplayDialog("WARNING!", "To auto push you need to enter a commit message", "OK", "Cancel");
                }

                else if (IFXToolSM.SelectionIsDirectoryBool(Selection.objects) == false)
                {
                    EditorUtility.DisplayDialog("WARNING!", "Please Only Have FOLDERS Selected", "OK", "Cancel");
                }
                else
                {
                    List <Object> selectedBundles = new List <Object>();
                    foreach (var dir in Selection.objects)
                    {
                        //check if the bundles has scene files and if they are the only file type present
                        if (IFXToolSM.DoesSelectedFolderContainOnlyScenes(dir) == false && IFXToolSM.DoesSelectedFolderContainFileType(dir, "*.unity") == true)
                        {
                            EditorUtility.DisplayDialog("WARNING!", "When Building scenes please ensure ONLY scene files are in the selected folder", "OK", "Cancel");
                            return;
                        }
                        //add the bundle so long as the above dosn't trigger
                        selectedBundles.Add(dir);
                    }
                    BundleBuildSettings buildSettings = new BundleBuildSettings();
                    buildSettings.selectedBundles      = selectedBundles;
                    buildSettings.windowsBuildYesNo    = windowsBuildYesNo;
                    buildSettings.androidBuildYesNo    = androidBuildYesNo;
                    buildSettings.iOSBuildYesNo        = iOSBuildYesNo;
                    buildSettings.buildQACheckOverride = buildQACheckOverride;
                    buildSettings.autoGitYesNo         = autoGitYesNo;
                    buildSettings.gitCommitMessage     = gitCommitM;

                    // Build the bundles!
                    bundleTools.BuildSelectedBundle(buildSettings);
                }
            }
            if (bundlesBuilding)
            {
                EditorGUILayout.LabelField("Building Bundles...", EditorStyles.boldLabel);
            }
        }