1.5.0: Added interface and utility class for adding settings to toolbar settings provider
This commit is contained in:
parent
12de62dabb
commit
91c9504910
25 changed files with 272 additions and 133 deletions
30
Editor/Toolbar/Tools/Settings/ToolbarUiSettings.cs
Normal file
30
Editor/Toolbar/Tools/Settings/ToolbarUiSettings.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue