Ejemplo n.º 1
0
    void ExecuteTurn()
    {
        coach1.OrderPlayers();
        coach2.OrderPlayers();
        player1.RpcCastIt();
        player2.RpcCastIt();
        statusUpdater();
        player1.RpcUpdateButtons();
        player2.RpcUpdateButtons();
        player1Ready = player1.status.blnHexed?true:false;
        player2Ready = player2.status.blnHexed?true:false;


        GameObject[] obstacles = GameObject.FindGameObjectsWithTag("obstacle");

        foreach (GameObject obstacle in obstacles)
        {
            obstacle.GetComponent <TurnLife>().DecreaseLife();
        }

        GameObject[] winds = GameObject.FindGameObjectsWithTag("Wind");


        foreach (GameObject wind in winds)
        {
            wind.GetComponent <TurnLife>().DecreaseLife();
        }

        GameObject[] chickens = GameObject.FindGameObjectsWithTag("chicken");

        foreach (GameObject chicken in chickens)
        {
            chicken.GetComponent <TurnLife>().DecreaseLife();
        }

        if (player1Ready && player2Ready)
        {
            i++;
            if (i < 5)
            {
                print("I value : " + i);
                ExecuteTurn();
            }
        }
    }