1.1.0: Added README and ToolbarSettings, so visibility of tools can be set in Preferences -> Module -> Toolbar
This commit is contained in:
parent
e1d2deb4c5
commit
9802f8aaa3
23 changed files with 297 additions and 43 deletions
29
Editor/Toolbar/Settings/ToolbarSettings.cs
Normal file
29
Editor/Toolbar/Settings/ToolbarSettings.cs
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
using UnityEditor;
|
||||
|
||||
namespace Module.NavigationTool.Editor.Toolbar
|
||||
{
|
||||
internal static class ToolbarSettings
|
||||
{
|
||||
private const string PREF_IS_UI_ENABLED = "ToolbarSettings_IsUiEnabled";
|
||||
private const string PREF_IS_UI_LAYER_ENABLED = "ToolbarSettings_IsUiLayerEnabled";
|
||||
private const string PREF_IS_SCENE_ENABLED = "ToolbarSettings_IsSceneEnabled";
|
||||
|
||||
public static bool IsUiEnabled
|
||||
{
|
||||
get => EditorPrefs.GetBool(PREF_IS_UI_ENABLED, true);
|
||||
set => EditorPrefs.SetBool(PREF_IS_UI_ENABLED, value);
|
||||
}
|
||||
|
||||
public static bool IsUiLayerEnabled
|
||||
{
|
||||
get => EditorPrefs.GetBool(PREF_IS_UI_LAYER_ENABLED, true);
|
||||
set => EditorPrefs.SetBool(PREF_IS_UI_LAYER_ENABLED, value);
|
||||
}
|
||||
|
||||
public static bool IsSceneEnabled
|
||||
{
|
||||
get => EditorPrefs.GetBool(PREF_IS_SCENE_ENABLED, true);
|
||||
set => EditorPrefs.SetBool(PREF_IS_SCENE_ENABLED, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Editor/Toolbar/Settings/ToolbarSettings.cs.meta
Normal file
3
Editor/Toolbar/Settings/ToolbarSettings.cs.meta
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ee57c1a04c9448e585e7e524886bdeda
|
||||
timeCreated: 1639924440
|
||||
41
Editor/Toolbar/Settings/ToolbarSettingsProvider.cs
Normal file
41
Editor/Toolbar/Settings/ToolbarSettingsProvider.cs
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Module.NavigationTool.Editor.Toolbar
|
||||
{
|
||||
internal static class ToolbarSettingsProvider
|
||||
{
|
||||
private static Styles STYLES;
|
||||
|
||||
[SettingsProvider]
|
||||
public static SettingsProvider GetProvider()
|
||||
{
|
||||
return new SettingsProvider("Module/Toolbar", SettingsScope.User)
|
||||
{
|
||||
label = "Toolbar",
|
||||
keywords = new[] { "Scene", "UI", "Toolbar" },
|
||||
guiHandler = OnGui
|
||||
};
|
||||
}
|
||||
|
||||
private static void OnGui(string searchContext)
|
||||
{
|
||||
if (STYLES == null)
|
||||
STYLES = new Styles();
|
||||
|
||||
STYLES.Initialize((GUI.skin));
|
||||
|
||||
EditorGUILayout.BeginVertical(STYLES.settingsGroup);
|
||||
{
|
||||
EditorGUILayout.LabelField("UI", EditorStyles.boldLabel);
|
||||
ToolbarSettings.IsUiEnabled = EditorGUILayout.Toggle("Enable Canvas picker", ToolbarSettings.IsUiEnabled);
|
||||
ToolbarSettings.IsUiLayerEnabled = EditorGUILayout.Toggle("Enable Layer toggle", ToolbarSettings.IsUiLayerEnabled);
|
||||
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.LabelField("Scene", EditorStyles.boldLabel);
|
||||
ToolbarSettings.IsSceneEnabled = EditorGUILayout.Toggle("Enable Scene picker", ToolbarSettings.IsSceneEnabled);
|
||||
}
|
||||
EditorGUILayout.EndVertical();
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Editor/Toolbar/Settings/ToolbarSettingsProvider.cs.meta
Normal file
11
Editor/Toolbar/Settings/ToolbarSettingsProvider.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 7254a01fd35a8c5499c07751fbd7d6fb
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Loading…
Add table
Add a link
Reference in a new issue