Exemplo n.º 1
0
 void UpdateTimer()
 {
     if ((time % 60) <= 0)
     {
         time           = 0;
         timerText.text = "00";
         StartCoroutine(endScreen.LoadScene());
     }
     else
     {
         time -= Time.deltaTime;
         string seconds = (time % 60).ToString("00");
         timerText.text  = seconds;
         lerpedColor     = Color.Lerp(Color.white, Color.black, Mathf.PingPong(Time.time, 1f));
         timerText.color = lerpedColor;
     }
 }