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:
parent
10d07b986f
commit
fe82c5c9fa
22 changed files with 669 additions and 48 deletions
37
Editor/Toolbar/Tools/ToolPlayerPrefs.cs
Normal file
37
Editor/Toolbar/Tools/ToolPlayerPrefs.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue