Exemplo n.º 1
0
 // Update is called once per frame
 void Update()
 {
     if (ContadorTempo <= tempo)
     {
         if (ContadorTempo > 11 && Tempo_Esgotando == false)
         {
             AudioSource.PlayClipAtPoint(Contagem_Som, Camera.main.transform.position, volume);
             Tempo_Esgotando = true;
         }
         ContadorTempo       = ContadorTempo + Time.deltaTime;
         barrinha.fillAmount = ContadorTempo / tempo;
     }
     if (barrinha.fillAmount == 1 && gm2.playerTurn == "YELLOW")
     {
         gm2.MovimentaYellowPlayer();
         barrinha.fillAmount = 0;
         ContadorTempo       = 0;
     }
     if (barrinha.fillAmount == 1 && gm2.playerTurn == "RED")
     {
         gm2.MovimentaRedPlayer();
         barrinha.fillAmount = 0;
         ContadorTempo       = 0;
     }
 }