Skip to content

Commit

Permalink
Fix timer values...again
Browse files Browse the repository at this point in the history
  • Loading branch information
adrian-miasik committed Oct 22, 2021
1 parent 96e8aff commit 5aee08c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions UnityPomodoro/Assets/AdrianMiasik/Scripts/PomodoroTimer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public enum States
// Time
private double currentTime;
private float totalTime; // In seconds
private bool firstTimePlaying = true;

// Pause Fade Animation
[Header("Fade Animation")]
Expand Down Expand Up @@ -484,6 +485,12 @@ public void HideInfo()
/// </summary>
public void Play()
{
if (firstTimePlaying)
{
firstTimePlaying = false;
CalculateTimeValues();
}

SwitchState(States.RUNNING);
}

Expand Down Expand Up @@ -526,6 +533,7 @@ public void Restart(bool _isCompleted)
digitFormat.FlipIsOnBreakBool();
}

firstTimePlaying = true;
SwitchState(States.SETUP);
CalculateTimeValues();

Expand Down

0 comments on commit 5aee08c

Please # to comment.