29 lines
1 KiB
C#
29 lines
1 KiB
C#
#if UNITY_6000_3_OR_NEWER
|
|
using UnityEditor;
|
|
using UnityEditor.Toolbars;
|
|
using UnityEngine;
|
|
using UnityEngine.Scripting;
|
|
|
|
namespace Module.NavigationTool.Editor.Toolbar
|
|
{
|
|
internal static class MainToolbarPlayerPrefsElement
|
|
{
|
|
[Preserve]
|
|
[MainToolbarElement("Toolbar/Player Prefs Delete", ussName = "", defaultDockIndex = 100, defaultDockPosition = MainToolbarDockPosition.Middle, menuPriority = 1500)]
|
|
public static MainToolbarElement Draw()
|
|
{
|
|
var icon = EditorGUIUtility.IconContent("d_CacheServerDisconnected").image as Texture2D;
|
|
var content = new MainToolbarContent(icon, "Deletes all PlayerPrefs entries");
|
|
return new MainToolbarButton(content, () =>
|
|
{
|
|
if (!EditorUtility.DisplayDialog("Delete PlayerPrefs", "Are you sure you want to delete all PlayerPrefs data?", "Yes", "No"))
|
|
return;
|
|
|
|
PlayerPrefs.DeleteAll();
|
|
PlayerPrefs.Save();
|
|
});
|
|
}
|
|
}
|
|
}
|
|
#endif
|