1.2.0: added TimeScale to toolbar

This commit is contained in:
Anders Ejlersen 2022-01-15 11:37:33 +01:00
parent 9802f8aaa3
commit 65ca5dd355
6 changed files with 52 additions and 3 deletions

View file

@ -7,16 +7,17 @@ namespace Module.NavigationTool.Editor.Toolbar
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";
private const string PREF_IS_TIME_SCALE_ENABLED = "ToolbarSettings.IsTimeScaleEnabled";
public static bool IsUiEnabled
{
get => EditorPrefs.GetBool(PREF_IS_UI_ENABLED, true);
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, true);
get => EditorPrefs.GetBool(PREF_IS_UI_LAYER_ENABLED, false);
set => EditorPrefs.SetBool(PREF_IS_UI_LAYER_ENABLED, value);
}
@ -25,5 +26,11 @@ namespace Module.NavigationTool.Editor.Toolbar
get => EditorPrefs.GetBool(PREF_IS_SCENE_ENABLED, true);
set => EditorPrefs.SetBool(PREF_IS_SCENE_ENABLED, value);
}
public static bool IsTimeScaleEnabled
{
get => EditorPrefs.GetBool(PREF_IS_TIME_SCALE_ENABLED, false);
set => EditorPrefs.SetBool(PREF_IS_TIME_SCALE_ENABLED, value);
}
}
}

View file

@ -34,6 +34,10 @@ namespace Module.NavigationTool.Editor.Toolbar
EditorGUILayout.Space();
EditorGUILayout.LabelField("Scene", EditorStyles.boldLabel);
ToolbarSettings.IsSceneEnabled = EditorGUILayout.Toggle("Enable Scene picker", ToolbarSettings.IsSceneEnabled);
EditorGUILayout.Space();
EditorGUILayout.LabelField("Time", EditorStyles.boldLabel);
ToolbarSettings.IsTimeScaleEnabled = EditorGUILayout.Toggle("Enable Time Scale slider", ToolbarSettings.IsTimeScaleEnabled);
}
EditorGUILayout.EndVertical();
}