Delete PlayerPrefs at runtime

Hi,

i want to delete the PlayerPrefs on button press.

PlayerPrefs.DeleteAll();

It works, but only if i restart the Editor or the Android build.
Why it does not work at runtime? Is there another way ?

Hm… Just out of curiosity, what makes you say you have to restart the editor (or android)?

You run that method, and then you can still look up keys while playing? If you exit play mode in the editor, and reload the game… all of the keys are still working?

I’m sure I’ve used it before in the editor without any issues like that, that’s odd.

So i have a button in Game to reset all saved data. Basically start a new Game and erase all unlocked levels, coins ect.
If i press the reset Button, then all data is still there but if i close the app or close the editor and restart it then everything is erased like expected.

But i dont want the Player to exit the game first to start a new level. I hope you understand it now better what i mean.
I want that the Button immediately reset everything at runtime.

public void DeleteAll()
    {
        PlayerPrefs.DeleteAll ();
    }

This is what the button calls. It only is visible at restart not at runtime

You probably have to call PlayerPrefs.Save();