Is there a simple way to delete all your playerprefs in the editor and webplayer?


I am making a main menu for a game I don't have but just making it and now working on the settings page. Here you must change settings and apply them so you save them in your PlayerPrefs. So when you start up the next time you can use the same settings.

When I changed a lot of code in my scripts I want to see how it works from first startup so I have to delete all my PlayerPrefs but how can i do this fast? because now I am doing them 1 by 1 with this for example :

PlayerPrefs.DeleteKey("Resolution"); PlayerPrefs.DeleteKey("Shadows"); and so on....

I am getting alot of variables to save now and going to be a huge job so i found this :

PlayerPrefs.DeleteAll and EditorPrefs.DeleteAll

but what is the difference is it save to use? I don't want to lose everything i made....

does editorpreference's delete just my preference's in unity -> edit -> preference's or something else?

and does PlayerPrefs.DeleteAll delete's just my PlayerPrefs or has it side effect? I hope i can use this because it saves me alot of time... I think its obvious that is save to use but i want to be sure because in other programs i thought i knew it but when I did it my project was corrupted....

I hope i can ask this kind of stuff and don't violate any rules.

Thanks in advance,


EDIT : and if DeleteAll is just deleting. does it affect only for the project or game you are using/playing at that moment or for all games and projects you have?

There is now Edit > Clear All PlayerPrefs to perform this from the editor.

PlayerPrefs.DeleteAll() is definitely safe. In fact I use it daily to test if a new player to the game can unlock everything starting from scratch.

I'm unsure what EditorPrefs.DeleteAll() does though.. The docs don't seem to explain very much My assumption is that EditorPrefs is meant to be used specifically for tools and editing. Meaning that nothing in your game code should rely on EditorPrefs settings. The player in a final build will not have access to this class because it is contained within UnityEditor which is not compiled into a build.


Quick Delete PlayerPrefs with Menu Button – Unity

code explanation:

using UnityEngine;
using UnityEditor;
public class DeletePlayerPrefsScript : EditorWindow
    [MenuItem("Window/Delete PlayerPrefs (All)")]
    static void DeleteAllPlayerPrefs()

use the menu:

Very easy to use FREE Asset is here :