1.3.3: Getting close to 1.0 in time scale will set it to 1.0

This commit is contained in:
Anders Ejlersen 2022-01-28 22:31:15 +01:00
parent 40fa4d7151
commit 0b147a9144
2 changed files with 4 additions and 1 deletions

View file

@ -26,6 +26,9 @@ namespace Module.NavigationTool.Editor.Toolbar
float temp = GUI.HorizontalSlider(r1, value, ToolbarSettings.TimeScaleMinValue, ToolbarSettings.TimeScaleMaxValue);
temp = Mathf.Clamp(temp, ToolbarSettings.TimeScaleMinValue, ToolbarSettings.TimeScaleMaxValue);
if (Mathf.Abs(temp - 1.0f) < 0.02f)
temp = 1.0f;
if (!Mathf.Approximately(value, temp))
Time.timeScale = temp;
}