Navigation tools upgraded to use the new MainToolbarElement API

This commit is contained in:
Anders Ejlersen 2025-12-06 15:17:30 +01:00
parent 708b99f763
commit 3e1602162c
52 changed files with 837 additions and 66 deletions

View file

@ -5,15 +5,24 @@ namespace Module.NavigationTool.Editor.Toolbar
internal sealed class ToolbarScenePickerSettings : IToolbarSettings
{
public string Title => "Scene";
#if !UNITY_6000_3_OR_NEWER
private const string PREF_IS_SCENE_ENABLED = "ToolbarSettings_IsSceneEnabled";
private const string PREF_SCENE_PICKER_LOAD_SET_AS_ADDITIVE_KEY = "ToolbarSettings_ScenePickerLoadSetAsAdditive";
#endif
private const string PREF_SCENE_PICKER_LOAD_SET_AS_ADDITIVE_KEY = "ToolbarSettings_ScenePickerLoadSetAsAdditive";
#if UNITY_6000_3_OR_NEWER
public bool EnableDraw => false;
#endif
#if !UNITY_6000_3_OR_NEWER
public static bool IsSceneEnabled
{
get => EditorPrefs.GetBool(PREF_IS_SCENE_ENABLED, true);
private set => EditorPrefs.SetBool(PREF_IS_SCENE_ENABLED, value);
}
#endif
public static bool IsScenePickerSetAsAdditive
{
@ -27,7 +36,9 @@ namespace Module.NavigationTool.Editor.Toolbar
public void Draw()
{
#if !UNITY_6000_3_OR_NEWER
IsSceneEnabled = EditorGUILayout.Toggle("Enable Scene picker", IsSceneEnabled);
#endif
}
}
}