Created
January 2, 2023 19:49
-
-
Save ricardj/4468eb743228845f409d5af4879cc65b to your computer and use it in GitHub Desktop.
Fast reset player prefs tool for unity.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEditor.EditorTools; | |
using UnityEngine; | |
[EditorTool("Reset player prefs")] | |
public class ResetPlayerPrefsEditorTool : EditorTool | |
{ | |
[SerializeField] | |
Texture2D m_ToolIcon; | |
GUIContent m_IconContent; | |
void OnEnable() | |
{ | |
m_IconContent = new GUIContent() | |
{ | |
image = m_ToolIcon, | |
}; | |
} | |
public override GUIContent toolbarIcon | |
{ | |
get { return m_IconContent; } | |
} | |
public override void OnActivated() | |
{ | |
base.OnActivated(); | |
PlayerPrefs.DeleteAll(); | |
Debug.Log("Deleted player prefs"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment