private static void runUpgradeTest()
        {
            //Check if we have old asset hunter installed already
            VersionUpgraderReady = getOldSettings().Length > 0;
            AH_PreProcessor.AddDefineSymbols(AH_PreProcessor.DefineHasOldVersion, VersionUpgraderReady);

            //Make sure we haven't chosen NOT to import
            if (EditorPrefs.HasKey(prefKey))
            {
                if (AH_Utils.IntToBool(EditorPrefs.GetInt(prefKey)) == true)
                {
                    return;
                }
            }

            if(VersionUpgraderReady)
                EditorUtility.DisplayDialog("Old Asset Hunter settings found", "To transfer old settings open 'Window->Asset Hunter Pro->Transfer Settings'", "Ok");

            EditorPrefs.SetInt(prefKey, 1);
        }
        private static void onTransferComplete()
        {
            AH_PreProcessor.AddDefineSymbols(AH_PreProcessor.DefineHasOldVersion, false);

            string folderPath = AssetDatabase.GUIDToAssetPath("0e2e4a3c5c6237b448de7afa87377b2e"); //The original GUID of the old Asset Hunter folder
            UnityEngine.Object oldFolder = AssetDatabase.LoadMainAssetAtPath(folderPath);

            if (oldFolder == null)
            {
                EditorUtility.DisplayDialog("Delete old asset hunter", "Copy complete,feel free to delete old Asset Hunter folder", "Ok");
            }
            else
            {
                if (EditorUtility.DisplayDialog("Delete old asset hunter", "Copy complete, do you want to delete " + folderPath + " immediately?", "Ok", "Cancel"))
                {
                    FileUtil.DeleteFileOrDirectory(folderPath);
                    AssetDatabase.Refresh();
                    VersionUpgraderReady = false;
                }
            }
        }
Esempio n. 3
0
        internal void DrawSettings()
        {
            EditorGUILayout.HelpBox("File save locations", MessageType.None);

            UserPreferencePath = drawSettingsFolder("User prefs", UserPreferencePath, AH_SettingsManager.InitialUserPrefPath);
            BuildInfoPath      = drawSettingsFolder("Build info", BuildInfoPath, AH_SettingsManager.InitialBuildInfoPath);
            EditorGUILayout.Space();

            EditorGUILayout.HelpBox("Settings", MessageType.None);
            AutoCreateLog  = drawSetting("Auto create log when building", AutoCreateLog, AH_SettingsManager.InitialValueAutoCreateLog);
            AutoOpenLog    = drawSetting("Auto open log location after building", AutoOpenLog, AH_SettingsManager.InitialValueAutoOpenLog);
            HideButtonText = drawSetting("Hide buttontexts", HideButtonText, AH_SettingsManager.InitialValueHideButtonText);

            EditorGUILayout.BeginHorizontal();
            EditorGUI.BeginChangeCheck();
            IgnoreScriptFiles = drawSetting("Ignore script files", IgnoreScriptFiles, AH_SettingsManager.InitialIgnoreScriptFiles);

            if (EditorGUI.EndChangeCheck())
            {
                //ADD OR REMOVE DEFINITION FOR PREPROCESSING
                AH_PreProcessor.AddDefineSymbols(AH_PreProcessor.DefineScriptAllow, !IgnoreScriptFiles);

                if (!IgnoreScriptFiles)
                {
                    EditorUtility.DisplayDialog("Now detecting unused scripts", "This is an experimental feature, and it cannot promise with any certainty that script files marked as unused are indeed unused. Only works with scripts that are directly used in a scene - Use at your own risk", "Ok");
                }
            }

            GUIContent content = new GUIContent("EXPERIMENTAL FEATURE!", EditorGUIUtility.IconContent("console.warnicon.sml").image, "Cant be 100% sure script files are usused, so you need to handle with care");

            //TODO PARTIAL CLASSES
            //INHERITANCE
            //AddComponent<Type>
            //Reflection
            //Interfaces

            EditorGUILayout.LabelField(content, EditorStyles.boldLabel);
            GUILayout.FlexibleSpace();
            EditorGUILayout.EndHorizontal();
        }