Navigation tools upgraded to use the new MainToolbarElement API
This commit is contained in:
parent
708b99f763
commit
3e1602162c
52 changed files with 837 additions and 66 deletions
|
|
@ -0,0 +1,28 @@
|
|||
#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
|
||||
Loading…
Add table
Add a link
Reference in a new issue