1.5.1: Added settings interface to readme file

This commit is contained in:
Anders Ejlersen 2022-02-14 22:22:06 +01:00
parent 91c9504910
commit 1d27a259e4
2 changed files with 35 additions and 2 deletions

View file

@ -59,3 +59,36 @@ The four properties help define draw and enable state:
* `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
### 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);
}
}
```

View file

@ -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",