Time scale: Added context menu to time scale, so it is possible to reset slider to 1.0
This commit is contained in:
parent
dd80d46ebb
commit
29ab1a90a0
|
|
@ -2,6 +2,12 @@
|
|||
All notable changes to this project will be documented in this file.
|
||||
|
||||
|
||||
## [1.11.1] - 2024-11-25
|
||||
|
||||
### Added
|
||||
- Added context menu to time scale, so it is possible to reset slider to 1.0
|
||||
|
||||
|
||||
## [1.11.0] - 2025-03-29
|
||||
|
||||
### Changed
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using JetBrains.Annotations;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UTools = UnityEditor.Tools;
|
||||
|
||||
namespace Module.NavigationTool.Editor.Toolbar
|
||||
{
|
||||
|
|
|
|||
|
|
@ -28,6 +28,16 @@ namespace Module.NavigationTool.Editor.Toolbar
|
|||
|
||||
EditorGUI.LabelField(r0, LABEL_TIME_SCALE, styles.centeredMiniLabel);
|
||||
EditorGUI.LabelField(r2, LABEL_TIME_VALUE, styles.centeredMiniLabel);
|
||||
|
||||
if (Event.current.keyCode == KeyCode.Mouse1 && rect.Contains(Event.current.mousePosition))
|
||||
{
|
||||
GenericMenu menu = new GenericMenu();
|
||||
menu.AddItem(new GUIContent("Reset"), false, () => Time.timeScale = 1f);
|
||||
menu.ShowAsContext();
|
||||
|
||||
Event.current.Use();
|
||||
}
|
||||
|
||||
float temp = GUI.HorizontalSlider(r1, value, ToolbarTimeSettings.TimeScaleMinValue, ToolbarTimeSettings.TimeScaleMaxValue);
|
||||
temp = Mathf.Clamp(temp, ToolbarTimeSettings.TimeScaleMinValue, ToolbarTimeSettings.TimeScaleMaxValue);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "com.module.navigationtool",
|
||||
"version": "1.11.0",
|
||||
"version": "1.11.1",
|
||||
"displayName": "Module.NavigationTool",
|
||||
"description": "Support for navigation tools, like favorites, history and toolbars",
|
||||
"unity": "2019.2",
|
||||
|
|
|
|||
Loading…
Reference in a new issue