1.5.1: Added settings interface to readme file
This commit is contained in:
parent
91c9504910
commit
1d27a259e4
35
README.md
35
README.md
|
|
@ -58,4 +58,37 @@ The four properties help define draw and enable state:
|
||||||
* `Visible`: If it is visible in the toolbar
|
* `Visible`: If it is visible in the toolbar
|
||||||
* `Enabled`: If it is enabled in the toolbar (`GUI.enabled`)
|
* `Enabled`: If it is enabled in the toolbar (`GUI.enabled`)
|
||||||
* `Placement`: If it is placed to the left or right of the play-buttons
|
* `Placement`: If it is placed to the left or right of the play-buttons
|
||||||
* `Priority`: Sort order/priority, when drawing the tool
|
* `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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "com.module.navigationtool",
|
"name": "com.module.navigationtool",
|
||||||
"version": "1.5.0",
|
"version": "1.5.1",
|
||||||
"displayName": "Module.NavigationTool",
|
"displayName": "Module.NavigationTool",
|
||||||
"description": "Support for navigation tools, like favorites, history and toolbars",
|
"description": "Support for navigation tools, like favorites, history and toolbars",
|
||||||
"unity": "2019.2",
|
"unity": "2019.2",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue