diff --git a/CHANGELOG.md b/CHANGELOG.md index 87da13a..07134ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/Editor/Toolbar/Tools/ToolBuild.cs b/Editor/Toolbar/Tools/ToolBuild.cs index ef42c4d..b8acbb7 100644 --- a/Editor/Toolbar/Tools/ToolBuild.cs +++ b/Editor/Toolbar/Tools/ToolBuild.cs @@ -1,6 +1,7 @@ using JetBrains.Annotations; using UnityEditor; using UnityEngine; +using UTools = UnityEditor.Tools; namespace Module.NavigationTool.Editor.Toolbar { diff --git a/Editor/Toolbar/Tools/ToolTimeScale.cs b/Editor/Toolbar/Tools/ToolTimeScale.cs index eb0f053..e61b689 100644 --- a/Editor/Toolbar/Tools/ToolTimeScale.cs +++ b/Editor/Toolbar/Tools/ToolTimeScale.cs @@ -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); diff --git a/package.json b/package.json index 148e9d4..6f93fd1 100644 --- a/package.json +++ b/package.json @@ -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",