PlayerPrefs.DeleteAll();
Complite, execute, erase line of code, compile and execute again.
Now I know better!, so we are going to setup a Menu Item to execute this at any time.
Lets create a new C# script, name it DeletePlayerPrefsData and add the following code:
using UnityEngine;
using UnityEditor;
public class DeletePlayerPrefsData {
[MenuItem("Assets/Delete Player Prefs")]
public static void DeletePlayerPrefs() {
PlayerPrefs.DeleteAll();
}
}
Here we put the location of the script function on the menu.
[MenuItem("Assets/Delete Player Prefs")]
Lastly we declare a static function just below [MenuItem] which would be the function that will execute when Delete Player Prefs is clicked.
No comments:
Post a Comment