Пример #1
0
 public static void ClearAll(bool prompt)
 {
     if (!prompt || EditorUtility.DisplayDialog("Clear Editor Prefs", "Delete all the editor preferences?", "Yes", "No"))
     {
         EditorPrefs.DeleteAll();
     }
 }
Пример #2
0
 public static void DeleteEditorPrefs(bool prompt)
 {
     if (!prompt || EditorUI.DrawDialog("Clear Editor Prefs", "Delete all the editor preferences?", "Yes", "No"))
     {
         EditorPrefs.DeleteAll();
     }
 }
Пример #3
0
 public static void DeleteEditorPrefs()
 {
     if (EditorUtility.DisplayDialog("Clear Editor Prefs", "Delete all the editor preferences?", "Yes", "No"))
     {
         EditorPrefs.DeleteAll();
     }
 }
Пример #4
0
 public static void ResetPrefs()
 {
     if (EditorUtility.DisplayDialog("Reset editor preferences?", "Reset all editor preferences? This cannot be undone.", "Yes", "No"))
     {
         EditorPrefs.DeleteAll();
     }
 }
Пример #5
0
    public static void DelteAllPlayerPrefs()
    {
#if EVAL_JUSTGOOD
        if (!GoodSVNPanel.CheckLicense())
        {
            return;
        }
#endif
        EditorPrefs.DeleteAll();
    }
Пример #6
0
 static void deleteAllExample()
 {
     if (EditorUtility.DisplayDialog("Delete all editor preferences.",
                                     "Are you sure you want to delete all the editor preferences? " +
                                     "This action cannot be undone.", "Yes", "No"))
     {
         Debug.Log("yes");
         EditorPrefs.DeleteAll();
     }
 }
Пример #7
0
 private void DeleteAll()
 {
     if (showEditorPrefs)
     {
         EditorPrefs.DeleteAll();
     }
     else
     {
         PlayerPrefs.DeleteAll();
     }
 }
Пример #8
0
    private static void DeleteEditorPrefs()
    {
        if (EditorUtility.DisplayDialog(
                "Erase everything?",
                "Erase all of EditorPrefs?",
                "Yes",
                "No"))
        {
            EditorPrefs.DeleteAll();
            Debug.LogWarning("All EditorPrefs data erased!");
        }
        else
        {
            // no op
        }

        return;
    }
Пример #9
0
    static void Save()
    {
        EditorPrefs.SetInt("MyInt", 100);
        EditorPrefs.SetFloat("MyFloat", 200f);
        EditorPrefs.SetString("MyString", "雨松MOMO");

        Debug.Log(EditorPrefs.GetInt("MyInt", 0));
        Debug.Log(EditorPrefs.GetFloat("MyFloat", 0f));
        Debug.Log(EditorPrefs.GetString("MyString", "没有返回默认值"));


        //判断是否有某个key
        if (EditorPrefs.HasKey("MyInt"))
        {
        }
        //删除某个Key
        EditorPrefs.DeleteKey("MyInt");

        //删除所有Key
        EditorPrefs.DeleteAll();
    }
Пример #10
0
        public static void clearEditorPrefs()
        {
            Fn <string, bool> check = title =>
                                      EditorUtility.DisplayDialog(
                "Clear editor prefs?",
                $"{title}\n\n" +
                $"This will delete all the settings you have set in Unity Editor " +
                $"(including SDK paths, color schemes and any data that custom plugins might have saved)\n\n" +
                $"!!! Use this as LAST RESORT only !!!",
                "Wipe them clean", "Cancel, I'm scared"
                );

            if (
                check("Are you sure?") &&
                check("Are you really sure?") &&
                check("You're sure you understand the consequences?")
                )
            {
                EditorPrefs.DeleteAll();
                Log.d.info("Editor prefs cleared. Good luck with that.");
            }
        }
Пример #11
0
 public void DeleteAll()
 {
     EditorPrefs.DeleteAll();
     ProjectSettings.Clear();
     ProjectSettings.Save();
 }
 public void DeleteAll() => EditorPrefs.DeleteAll();
 static public void Reset()
 {
     EditorPrefs.DeleteAll();
 }
 public static void DeleteAll()
 {
     EditorPrefs.DeleteAll();
 }
Пример #15
0
 public static void CleanEditorPrefs()
 {
     EditorPrefs.DeleteAll();
 }
Пример #16
0
 /// <summary>
 /// Remove all settings.
 /// </summary>
 public void DeleteAll()
 {
     EditorPrefs.DeleteAll();
     Clear();
     Save();
 }
 static void deleteAllExample()
 {
     EditorPrefs.DeleteAll();
 }
Пример #18
0
 /// <inheritdoc />
 protected override bool OnStepStart()
 {
     EditorPrefs.DeleteAll();
     return(true);
 }
Пример #19
0
 static void ClearEditorPrefs()
 {
     EditorPrefs.DeleteAll();
 }
        private void OnGUI()
        {
            if (hasLoaded == false)
            {
                windowData = dataManager.LoadWindowData();
                saveDialogueNextToAudioFile = EditorPrefs.GetBool(CustomEditorPrefs.dialogueToggle);
                hasLoaded = true;
            }

            if (GUILayout.Button("asd"))
            {
                EditorPrefs.DeleteAll();
            }


            GUILayout.Label("Set necessary paths", EditorStyles.boldLabel);
            GUILayout.Label("Default values might be incorrect", EditorStyles.label);
            GUILayout.Space(20);

            EditorGUI.BeginChangeCheck();
            windowData.PluginPath = EditorGUILayout.TextField("Plugin path", windowData.PluginPath.Equals(DefaultPaths.defaultPluginPath) ? OnDefaultPathSet(ConfigDataType.Plugin) : windowData.PluginPath);
            if (EditorGUI.EndChangeCheck() == true)
            {
                dataManager.SaveWindowData(ConfigDataType.Plugin, windowData.PluginPath);
            }

            EditorGUI.BeginChangeCheck();
            windowData.AcousticModelPath = EditorGUILayout.TextField("Acoustic model path", windowData.AcousticModelPath.Equals(DefaultPaths.defaultAcousticModelPath) ? OnDefaultPathSet(ConfigDataType.AcousticModel) : windowData.AcousticModelPath);
            if (EditorGUI.EndChangeCheck() == true)
            {
                dataManager.SaveWindowData(ConfigDataType.AcousticModel, windowData.AcousticModelPath);
            }

            EditorGUI.BeginChangeCheck();
            windowData.DictionaryPath = EditorGUILayout.TextField("Dictionary path", windowData.DictionaryPath.Equals(DefaultPaths.defaultDictionaryPath) ? OnDefaultPathSet(ConfigDataType.Dictionary) : windowData.DictionaryPath);
            if (EditorGUI.EndChangeCheck() == true)
            {
                dataManager.SaveWindowData(ConfigDataType.Dictionary, windowData.DictionaryPath);
            }

            EditorGUI.BeginChangeCheck();
            windowData.TempFolderPath = EditorGUILayout.TextField("Temp folder path", windowData.TempFolderPath.Equals(DefaultPaths.defaultTempFolderPath) ? OnDefaultPathSet(ConfigDataType.TempFolder) : windowData.TempFolderPath);
            if (EditorGUI.EndChangeCheck() == true)
            {
                dataManager.SaveWindowData(ConfigDataType.TempFolder, windowData.TempFolderPath);
            }

            EditorGUI.BeginChangeCheck();
            float originalWidth = EditorGUIUtility.labelWidth;

            EditorGUIUtility.labelWidth = 250;
            windowData.DialogueToggle   = EditorGUILayout.Toggle("Save dialogue data in audio file directory", windowData.DialogueToggle);
            EditorGUIUtility.labelWidth = originalWidth;
            if (EditorGUI.EndChangeCheck() == true)
            {
                dataManager.SaveWindowData(ConfigDataType.DialogueToggle, windowData.DialogueToggle);
            }

            EditorGUI.BeginDisabledGroup(windowData.DialogueToggle);
            EditorGUI.BeginChangeCheck();
            windowData.DialogueDataSavingPath = EditorGUILayout.TextField("Dialogue folder path", windowData.DialogueDataSavingPath.Equals(DefaultPaths.defaultDialogueSavingPath) ? OnDefaultPathSet(ConfigDataType.DialoguePath) : windowData.DialogueDataSavingPath);
            if (EditorGUI.EndChangeCheck() == true)
            {
                dataManager.SaveWindowData(ConfigDataType.DialoguePath, windowData.DialogueDataSavingPath);
            }
            EditorGUI.EndDisabledGroup();
        }
Пример #21
0
    //

    void OnGUI()
    {
        GUILayout.Label("Set the configuration for your custom Text Hint.");


        EditorGUILayout.Space();

        if (defaultSize < 10)
        {
            defaultSize = 10;
        }
        if (defaultSize > 100)
        {
            defaultSize = 100;
        }

        defaultSpaceBefore = EditorGUILayout.IntField("Space Before", defaultSpaceBefore);
        if (defaultSpaceBefore < -2)
        {
            defaultSpaceBefore = -2;
        }
        if (defaultSpaceBefore > 100)
        {
            defaultSpaceBefore = 100;
        }

        defaultHeight = EditorGUILayout.IntField("Height", defaultHeight);
        if (defaultHeight < -10)
        {
            defaultHeight = -10;
        }
        if (defaultHeight > 100)
        {
            defaultHeight = 100;
        }

        defaultSpaceAfter = EditorGUILayout.IntField("Space After", defaultSpaceAfter);
        if (defaultSpaceAfter < 0)
        {
            defaultSpaceAfter = 0;
        }
        if (defaultSpaceAfter > 100)
        {
            defaultSpaceAfter = 100;
        }

        EditorGUILayout.Space();

        defaultWidth = EditorGUILayout.IntField("Width", defaultWidth);
        if (defaultWidth < 0)
        {
            defaultWidth = 0;
        }
        if (defaultWidth > 100)
        {
            defaultWidth = 100;
        }

        defaultInnerWidth = EditorGUILayout.IntField("Inner Width", defaultInnerWidth);
        if (defaultInnerWidth < -50)
        {
            defaultInnerWidth = -50;
        }
        if (defaultInnerWidth > 100)
        {
            defaultInnerWidth = 100;
        }

        EditorGUILayout.Space();

        defaultAnchor = (TextAnchor)EditorGUILayout.EnumPopup("Anchor", defaultAnchor);
        defaultStyle  = (FontStyle)EditorGUILayout.EnumPopup("Style", defaultStyle);

        EditorGUILayout.Space();

        defaultSize = EditorGUILayout.IntField("Text Size", defaultSize);
        boxEnabled  = EditorGUILayout.Toggle("Show Box", boxEnabled);

        EditorGUILayout.Space();

        defaultColor    = (ShowInfoColor)EditorGUILayout.EnumPopup("Text Color", defaultColor);
        defaultBoxColor = (ShowInfoColor)EditorGUILayout.EnumPopup("Box Color", defaultBoxColor);

        EditorGUILayout.Space();

        sample = EditorGUILayout.TextField("Hint", sample);

        ///

        Rect lr = GUILayoutUtility.GetLastRect();

        int bugFix = 20;

        if (boxEnabled)
        {
            EditorGUI.DrawRect(new Rect(lr.position.x + defaultWidth,
                                        lr.position.y + bugFix + defaultSpaceBefore, lr.width - defaultWidth * 2,
                                        lr.height + defaultHeight + 2), ShowInfoStyles.ConfigColor(defaultBoxColor));
        }

        GUIStyle style = new GUIStyle(EditorStyles.label);

        style.fontStyle        = defaultStyle;
        style.alignment        = defaultAnchor;
        style.fontSize         = Mathf.RoundToInt(defaultSize);
        style.normal.textColor = ShowInfoStyles.ConfigColor(defaultColor);

        GUI.Label(new Rect(lr.position.x + defaultWidth + defaultInnerWidth,
                           lr.position.y + bugFix + defaultSpaceBefore, lr.width - defaultWidth - defaultInnerWidth,
                           lr.height + defaultHeight + 2), sample, style);

        EditorGUILayout.Space(defaultSpaceBefore + defaultHeight + defaultSpaceAfter + bugFix - 4);

        ///

        if (GUILayout.Button("Apply"))
        {
            Save();
        }

        EditorGUILayout.Space();

        if (GUILayout.Button("Clear Data"))
        {
            EditorPrefs.DeleteAll();
        }
    }
Пример #22
0
 private static void ResetPrefs()
 {
     EditorPrefs.DeleteAll();
     EditorPrefs.SetBool("enabled", true);
     AssetDatabase.Refresh();
 }
    public override void OnInspectorGUI()
    {
        base.DrawDefaultInspector();

        FpsControllerLPFP fpsController        = (FpsControllerLPFP)target;
        float             _wSpeed              = fpsController.walkingSpeed;
        float             _rSpeed              = fpsController.runningSpeed;
        float             _mSmootheness        = fpsController.movementSmoothness;
        float             _jumpForce           = fpsController.jumpForce;
        float             _mouseSensitivity    = fpsController.mouseSensitivity;
        float             _rotationSmootheness = fpsController.rotationSmoothness;
        float             _minAngle            = fpsController.minVerticalAngle;
        float             _maxAngle            = fpsController.maxVerticalAngle;



        GUILayout.Space(20f);
        GUILayout.Label("Custom Editor Elements", EditorStyles.boldLabel);

        GUILayout.Space(10f);

        GUILayout.BeginHorizontal();
        GUILayout.Label("Preset Name", GUILayout.Width(labelWidth));
        presetName = GUILayout.TextField(presetName);
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        if (GUILayout.Button("Save"))
        {
            EditorPrefs.SetString("Preset Name", presetName);

            EditorPrefs.SetFloat("Walking Speed", _wSpeed);
            EditorPrefs.SetFloat("Running Speed", _rSpeed);
            EditorPrefs.SetFloat("Movement Smootheness", _mSmootheness);
            EditorPrefs.SetFloat("Jump Force", _jumpForce);
            EditorPrefs.SetFloat("Mouse Sensitivity", _mouseSensitivity);
            EditorPrefs.SetFloat("Rotation Smootheness", _rotationSmootheness);
            EditorPrefs.SetFloat("Min. Vertical Angle", _minAngle);
            EditorPrefs.SetFloat("Max. Vertical Angle", _maxAngle);

            Debug.Log("Preset Saved");
        }

        if (GUILayout.Button("Load"))
        {
            EditorPrefs.GetString("Preset Name", presetName);

            fpsController.walkingSpeed       = EditorPrefs.GetFloat("Walking Speed", 5f);
            fpsController.runningSpeed       = EditorPrefs.GetFloat("Running Speed", 9f);
            fpsController.movementSmoothness = EditorPrefs.GetFloat("Movement Smootheness", 0.1f);
            fpsController.jumpForce          = EditorPrefs.GetFloat("Jump Force", 30f);
            fpsController.mouseSensitivity   = EditorPrefs.GetFloat("Mouse Sensitivity", 5);
            fpsController.rotationSmoothness = EditorPrefs.GetFloat("Rotation Smootheness", 0.05f);
            fpsController.minVerticalAngle   = EditorPrefs.GetFloat("Min. Vertical Angle", -90);
            fpsController.maxVerticalAngle   = EditorPrefs.GetFloat("Max. Vertical Angle", 90);
            Debug.Log("Preset Loaded");
        }

        if (GUILayout.Button("Reset"))
        {
            EditorPrefs.DeleteAll();
            fpsController.walkingSpeed       = EditorPrefs.GetFloat("Walking Speed", 5f);
            fpsController.runningSpeed       = EditorPrefs.GetFloat("Running Speed", 9f);
            fpsController.movementSmoothness = EditorPrefs.GetFloat("Movement Smootheness", 0.1f);
            fpsController.jumpForce          = EditorPrefs.GetFloat("Jump Force", 30f);
            fpsController.mouseSensitivity   = EditorPrefs.GetFloat("Mouse Sensitivity", 5);
            fpsController.rotationSmoothness = EditorPrefs.GetFloat("Rotation Smootheness", 0.05f);
            fpsController.minVerticalAngle   = EditorPrefs.GetFloat("Min. Vertical Angle", -90);
            fpsController.maxVerticalAngle   = EditorPrefs.GetFloat("Max. Vertical Angle", 90);
            Debug.Log("Preset Reset");
        }

        GUILayout.EndHorizontal();
    }
Пример #24
0
 private static void ClearPreferences()
 {
     EditorPrefs.DeleteAll();
 }
Пример #25
0
 public static void ClearEditorPrefs_OnClick()
 {
     EditorPrefs.DeleteAll();
 }
 public static void ResetAndStart()
 {
     EditorPrefs.DeleteAll();
     Start();
 }
Пример #27
0
 public override void    DeleteAll()
 {
     EditorPrefs.DeleteAll();
 }