Skip to content

Commit

Permalink
fix(pause): Ensure scale time doesn't go below 0
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Jun 6, 2023
1 parent c03e2a2 commit 70a1d39
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Assets/JCSUnity/Scripts/Managers/JCS_PauseManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,9 @@ private void DoAsymp()
return;

Time.timeScale += (mTargetTimeScale - Time.timeScale) / mFriction * Time.unscaledDeltaTime;

// Prevent lower than 0!
Time.timeScale = Mathf.Max(0.0f, Time.timeScale);
}
}
}

0 comments on commit 70a1d39

Please sign in to comment.