Beispiel #1
0
    public void goal(int team)
    {
        scores[team]++;
        print("Team: " + team + " scored a goal");
        score.text = scores[0] + " - " + scores[1];

//        resetGameObjects();


        //pausa
        pauseGame();
        //activar celebrar
        foreach (GameObject g in entities)
        {
            CelebrateJump j = g.GetComponent <CelebrateJump>();
            if (j != null && team.ToString() == g.tag)
            {
                j.enabled = true;
            }
        }
        //invoke
        Invoke("ResetRound", 3f);
        sc.Play();
        //ball.GetComponent<Rigidbody>().velocity = Vector3.zero;
        //ball.transform.position = new Vector3(-7, 12, -12);
    }
Beispiel #2
0
 void ResetRound()
 {
     pauseGame();
     foreach (GameObject g in entities)
     {
         CelebrateJump j = g.GetComponent <CelebrateJump>();
         if (j != null)
         {
             j.enabled = false;
         }
     }
     resetGameObjects();
     blueTeamManager_tree.enabled = false;
     blueTeamManager_tree.enabled = true;
 }