1.5.1: Added settings interface to readme file
This commit is contained in:
parent
91c9504910
commit
1d27a259e4
33
README.md
33
README.md
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Reference in a new issue