diff --git a/README.md b/README.md index c083003..86f5927 100644 --- a/README.md +++ b/README.md @@ -58,4 +58,37 @@ The four properties help define draw and enable state: * `Visible`: If it is visible in the toolbar * `Enabled`: If it is enabled in the toolbar (`GUI.enabled`) * `Placement`: If it is placed to the left or right of the play-buttons -* `Priority`: Sort order/priority, when drawing the tool \ No newline at end of file +* `Priority`: Sort order/priority, when drawing the tool + + +### Customization - Settings + +To add enable/disable settings or more to Preferences -> Toolbar, you can implement `IToolbarSettings`. + +``` +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); + } +} +``` \ No newline at end of file diff --git a/package.json b/package.json index c0dcc2c..f249752 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.module.navigationtool", - "version": "1.5.0", + "version": "1.5.1", "displayName": "Module.NavigationTool", "description": "Support for navigation tools, like favorites, history and toolbars", "unity": "2019.2",