Skip to content

Commit

Permalink
Fixed Pause/Step Debug Feature colliding with game pause.
Browse files Browse the repository at this point in the history
  • Loading branch information
peeweek committed Mar 2, 2020
1 parent 4bdf533 commit 9d657b5
Showing 1 changed file with 12 additions and 21 deletions.
33 changes: 12 additions & 21 deletions Assets/Scripts/Debug/FPSManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,33 +34,24 @@ private void Update()

if (MillisecondCounter != null)
MillisecondCounter.text = $"{((dt * 1000).ToString("F2"))}ms.";
}

if(paused)
{
if(step)
if (paused && step)
{
Time.timeScale = 1.0f;
step = false;
}
else
{
Time.timeScale = 0.0f;
}
}
else
{
Time.timeScale = 1.0f;
}

if (Input.GetKeyDown(PauseKey))
{
paused = !paused;
}
else if (Input.GetKeyDown(StepKey))
{
paused = true;
step = true;
if (Input.GetKeyDown(PauseKey))
{
paused = !paused;
Time.timeScale = paused? 0.0f : 1.0f;
}
else if (Input.GetKeyDown(StepKey))
{
paused = true;
step = true;
Time.timeScale = 1.0f;
}
}
}

Expand Down

0 comments on commit 9d657b5

Please sign in to comment.