1.5.0: Added interface and utility class for adding settings to toolbar settings provider

This commit is contained in:
Anders Ejlersen 2022-02-14 20:57:58 +01:00
parent 12de62dabb
commit 91c9504910
25 changed files with 272 additions and 133 deletions

View file

@ -0,0 +1,30 @@
using UnityEditor;
namespace Module.NavigationTool.Editor.Toolbar
{
internal sealed class ToolbarUiSettings : IToolbarSettings
{
public string Title => "UI";
private const string PREF_IS_UI_ENABLED = "ToolbarSettings_IsUiEnabled";
private const string PREF_IS_UI_LAYER_ENABLED = "ToolbarSettings_IsUiLayerEnabled";
public static bool IsUiEnabled
{
get => EditorPrefs.GetBool(PREF_IS_UI_ENABLED, false);
set => EditorPrefs.SetBool(PREF_IS_UI_ENABLED, value);
}
public static bool IsUiLayerEnabled
{
get => EditorPrefs.GetBool(PREF_IS_UI_LAYER_ENABLED, false);
set => EditorPrefs.SetBool(PREF_IS_UI_LAYER_ENABLED, value);
}
public void Draw()
{
IsUiEnabled = EditorGUILayout.Toggle("Enable Canvas picker", IsUiEnabled);
IsUiLayerEnabled = EditorGUILayout.Toggle("Enable Layer toggle", IsUiLayerEnabled);
}
}
}