@@ -7,12 +7,9 @@ public class ToolbarController : MonoBehaviour
7
7
private static readonly char DASH = '–' ;
8
8
private static readonly float FPS = 60f ;
9
9
10
- // public bool active = true;
11
10
private int current = 0 ;
12
- // private int prev = 0;
13
11
14
12
public GameObject RadialTimer ;
15
- // public Text display;
16
13
public Text score ;
17
14
public Text level ;
18
15
@@ -34,7 +31,6 @@ void Update()
34
31
35
32
private void Restart ( )
36
33
{
37
- // SetActive();
38
34
ResetTimerFill ( ) ;
39
35
StartCoroutine ( CountdownStart ( ) ) ;
40
36
StartCoroutine ( RadialTimerStart ( ) ) ;
@@ -47,7 +43,6 @@ private float GetTimerStep()
47
43
48
44
private void DoOnCountRestart ( )
49
45
{
50
- // Show();
51
46
StopAllCoroutines ( ) ;
52
47
ResetTimer ( ) ;
53
48
Restart ( ) ;
@@ -59,10 +54,6 @@ private IEnumerator RadialTimerStart()
59
54
{
60
55
while ( IsRunning ( ) )
61
56
{
62
- // if (!active)
63
- // {
64
- // yield break;
65
- // }
66
57
RadialTimer . GetComponent < Image > ( ) . fillAmount += GetTimerStep ( ) ;
67
58
yield return new WaitForFixedUpdate ( ) ;
68
59
}
@@ -72,21 +63,14 @@ private IEnumerator CountdownStart()
72
63
{
73
64
while ( IsRunning ( ) )
74
65
{
75
- // if (!active)
76
- // {
77
- // yield break;
78
- // }
79
- // UpdateText();
80
66
yield return new WaitForSeconds ( 1f ) ;
81
67
DecrementTimer ( ) ;
82
68
}
83
- // UpdateText();
84
69
GameEvents . instance . TriggerCountEnd ( ) ;
85
70
}
86
71
87
72
private void ResetTimer ( )
88
73
{
89
- // prev = current;
90
74
current = GameStore . instance . timer ;
91
75
}
92
76
@@ -102,14 +86,6 @@ private bool IsRunning()
102
86
103
87
private void UpdateScoreText ( )
104
88
{
105
- // if (GameStore.instance.win || GameStore.instance.loose)
106
- // {
107
- // display.text = prev.ToString();
108
- // }
109
- // else
110
- // {
111
- // display.text = current.ToString();
112
- // }
113
89
score . text = GameStore . instance . score . ToString ( ) ;
114
90
}
115
91
@@ -120,16 +96,6 @@ private void UpdateLevelText()
120
96
level . text = $ "{ weight } { DASH } { step } ";
121
97
}
122
98
123
- // private void SetActive()
124
- // {
125
- // active = true;
126
- // }
127
-
128
- // private void SetInactive()
129
- // {
130
- // active = false;
131
- // }
132
-
133
99
public void HideTimer ( )
134
100
{
135
101
RadialTimer . SetActive ( false ) ;
0 commit comments