Method 1 – PlayerPrefs.DeleteAll()

You can create a menu item within the Unity Editor that will delete all of your PlayerPrefs for you. This is helpful for this issue as well as helping you delete saved data in other scenarios.

To create a menu item within the Unity Editor that will delete all of your PlayerPrefs, complete the following steps:

  1. Create a new folder in your Assets folder called Editor.
  2. Create a new C# Script and name it DeletePrefs.cs within the Editor folder. It will not work unless it is placed in a folder called Editor, so be sure to do that:
  1. Open the DeletePrefs.cs ...

Get Mastering UI Development with Unity now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.