Beispiel #1
0
 public void Scored(bool leftTeam)
 {
     leftOut  = 0;
     rightOut = 0;
     if (leftTeam)
     {
         score_Left++;
         UI_score_Left.text = "SCORE:   " + score_Left;
         Goalz[1].GetComponent <Goals>().Confetti(colour_Left);
         if (score_Left >= 3 && !gameOver)
         {
             winMenu.SetActive(true);
             UI_winText.text  = "LEFT";
             UI_winText.color = colour_Left;
             gameOver         = true;
             foreach (GameObject goal in Goalz)
             {
                 Goals GS = goal.GetComponent <Goals>();
                 GS.Confetti(colour_Left);
             }
             FreezePlayers();
         }
     }
     else
     {
         score_Right++;
         UI_score_Right.text = "SCORE:   " + score_Right;
         Goalz[0].GetComponent <Goals>().Confetti(colour_Right);
         if (score_Right >= 3 && !gameOver)
         {
             winMenu.SetActive(true);
             UI_winText.text  = "RIGHT";
             UI_winText.color = colour_Right;
             gameOver         = true;
             foreach (GameObject goal in Goalz)
             {
                 Goals GS = goal.GetComponent <Goals>();
                 GS.Confetti(colour_Right);
             }
             FreezePlayers();
         }
     }
     if (!gameOver)
     {
         NextRound();
     }
 }