1.8.0: Added target frame rate and PlayerPrefs.Delete to toolbar

- 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
This commit is contained in:
Anders Ejlersen 2022-12-07 22:10:09 +01:00
parent 10d07b986f
commit fe82c5c9fa
22 changed files with 669 additions and 48 deletions

View file

@ -0,0 +1,37 @@
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;
}
}
}