- Added: Tooltips on all buttons and labels in toolbar tools - Added: Target frame rate with `[min;max]` slider in toolbar - Added: `PlayerPrefs` delete button added to toolbar - Added: Option to select Single/Additive scene load/unload to scene picker - Added: All `IToolbarSettings` will be grouped with a foldout-toggle in Preferences
37 lines
1.3 KiB
C#
37 lines
1.3 KiB
C#
using JetBrains.Annotations;
|
|
using UnityEditor;
|
|
using UnityEngine;
|
|
using UTools = UnityEditor.Tools;
|
|
|
|
namespace Module.NavigationTool.Editor.Toolbar
|
|
{
|
|
[UsedImplicitly]
|
|
internal sealed class ToolPlayerPrefs : AbstractToolbarDrawer
|
|
{
|
|
public override bool Visible => ToolbarPlayerPrefsSettings.IsPlayerPrefsEnabled;
|
|
public override bool Enabled => true;
|
|
public override EToolbarPlacement Placement => EToolbarPlacement.Right;
|
|
public override int Priority => (int)EToolbarPriority.Low;
|
|
|
|
private static readonly GUIContent LABEL_DELETE = new GUIContent(string.Empty, "Deletes all PlayerPrefs entries");
|
|
|
|
protected override void Draw(Rect rect)
|
|
{
|
|
bool isDeleteButtonPressed = GUI.Button(rect, styles.iconDisconnect, styles.button);
|
|
GUI.Label(rect, LABEL_DELETE, styles.labelCenter);
|
|
|
|
if (!isDeleteButtonPressed)
|
|
return;
|
|
if (!EditorUtility.DisplayDialog("Delete PlayerPrefs", "Are you sure you want to delete all PlayerPrefs data?", "Yes", "No"))
|
|
return;
|
|
|
|
PlayerPrefs.DeleteAll();
|
|
PlayerPrefs.Save();
|
|
}
|
|
|
|
public override float CalculateWidth()
|
|
{
|
|
return 24.0f;
|
|
}
|
|
}
|
|
} |