Skip to content

Instantly share code, notes, and snippets.

@ricardj
Created January 2, 2023 19:49
Show Gist options
  • Save ricardj/4468eb743228845f409d5af4879cc65b to your computer and use it in GitHub Desktop.
Save ricardj/4468eb743228845f409d5af4879cc65b to your computer and use it in GitHub Desktop.
Fast reset player prefs tool for unity.
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