Пример #1
0
 void AnimCNTRLFromClipsWindowUI()
 {
     QuickToolsHelp.AnimClipsFromFBXInstructions(); // displays the instructions for this tool
     if (GUILayout.Button("Quick Create Anim Controlers"))
     {
         IFXToolSM.CreateAnimClipsFromSelectedFBX();
     }
 }
Пример #2
0
 void NewDependenciesWindowUI()
 {
     // Create all the folders and stuff for a new dependencie
     QuickToolsHelp.NewDependenciesWindowInstructions(); // displays the instructions for this tool
     folderName = EditorGUILayout.TextField("Folder Name: ", folderName);
     if (GUILayout.Button("Create Folders"))
     {
         IFXToolSM.CreateDependenciesFolder(userSettings.currentIFXNum, folderName);
     }
 }
Пример #3
0
        void AutoPivotUI()
        {
            QuickToolsHelp.AutoPivotInstructions(); // displays the instructions for this tool
            altCenterMethod = GUILayout.Toggle(altCenterMethod, "ALT Centering");

            if (GUILayout.Button("Auto Pivot"))
            {
                if (Selection.gameObjects != null)
                {
                    //string assetPath = PrefabUtility.GetPrefabAssetPathOfNearestInstanceRoot(Selection.gameObjects[0]);
                    //string assetPath = AssetDatabase.GetAssetPath(Selection.gameObjects[0]);
                    //Debug.Log("Asset path is: "+assetPath);
                    IFXToolSM.BatchCenterIFX(Selection.gameObjects, false);
                }
                else
                {
                    Debug.Log("Nothing selected - please select the top most object of the hierarchy and try again");
                }
            }
        }
Пример #4
0
        void BatchPrefabWindowUI()
        {
            QuickToolsHelp.BatchMakePrefabsInstructions(); // displays the instructions for this tool

            destinationFolder = EditorGUILayout.TextField("Destination Folder:", destinationFolder);
            if (GUILayout.Button("Set Destination Folder"))
            {
                destinationFolder = AssetDatabase.GetAssetPath(Selection.activeObject);
            }
            if (GUILayout.Button("Make Prefabs"))
            {
                // Loop through every GameObject in the array above
                foreach (GameObject gameObject in Selection.objects)
                {
                    // Set the path as within the Assets folder,
                    // and name it as the GameObject's name with the .Prefab format
                    string localPath = destinationFolder + "/" + gameObject.name + ".prefab";
                    // Make sure the file name is unique, in case an existing Prefab has the same name.
                    localPath = AssetDatabase.GenerateUniqueAssetPath(localPath);
                    // Create the new Prefab.
                    PrefabUtility.SaveAsPrefabAssetAndConnect(gameObject, localPath, InteractionMode.UserAction);
                }
            }
        }
Пример #5
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);
            }
        }