- 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
64 lines
2 KiB
C#
64 lines
2 KiB
C#
using UnityEditor;
|
|
using UnityEngine;
|
|
|
|
namespace Module.NavigationTool.Editor.Toolbar
|
|
{
|
|
public sealed class Styles
|
|
{
|
|
public GUIStyle popup;
|
|
public GUIStyle button;
|
|
public GUIStyle buttonNoPadding;
|
|
public GUIStyle slider;
|
|
public GUIStyle label;
|
|
public GUIStyle labelCenter;
|
|
public GUIStyle settingsGroup;
|
|
public GUIStyle centeredMiniLabel;
|
|
|
|
public GUIContent iconPlusSmall;
|
|
public GUIContent iconPlusTiny;
|
|
public GUIContent iconDisconnect;
|
|
|
|
private GUISkin skin;
|
|
|
|
public void Initialize(GUISkin skin)
|
|
{
|
|
if (this.skin == skin)
|
|
return;
|
|
|
|
this.skin = skin;
|
|
popup = new GUIStyle(skin.FindStyle("ToolbarPopup"));
|
|
button = new GUIStyle(skin.FindStyle("toolbarbutton"));
|
|
slider = new GUIStyle(skin.FindStyle("ToolbarSlider"));
|
|
label = new GUIStyle(skin.FindStyle("ToolbarLabel"));
|
|
|
|
if (EditorGUIUtility.isProSkin)
|
|
{
|
|
centeredMiniLabel = EditorStyles.centeredGreyMiniLabel;
|
|
}
|
|
else
|
|
{
|
|
centeredMiniLabel = new GUIStyle(EditorStyles.centeredGreyMiniLabel);
|
|
centeredMiniLabel.normal.textColor = label.normal.textColor;
|
|
}
|
|
|
|
buttonNoPadding = new GUIStyle(skin.FindStyle("toolbarbutton"))
|
|
{
|
|
padding = new RectOffset()
|
|
};
|
|
|
|
labelCenter = new GUIStyle(skin.FindStyle("ToolbarLabel"))
|
|
{
|
|
alignment = TextAnchor.MiddleCenter
|
|
};
|
|
|
|
settingsGroup = new GUIStyle
|
|
{
|
|
margin = new RectOffset(8, 0, 8, 0)
|
|
};
|
|
|
|
iconPlusSmall = EditorGUIUtility.IconContent("d_CreateAddNew");
|
|
iconPlusTiny = EditorGUIUtility.IconContent("Toolbar Plus");
|
|
iconDisconnect = EditorGUIUtility.IconContent("d_CacheServerDisconnected");
|
|
}
|
|
}
|
|
} |