Esempio n. 1
0
    /*
     *
     *
     * THIS PART IS FOR UPDATE GAME DATA FUNCTION
     *
     *
     */

    /**
     * Function for update current team members for each team list object
     **/
    private void UpdateTeamMembers()
    {
        foreach (GameObject child in team)
        {
            TeamController teamController = child.GetComponent <TeamController>();

            switch (teamController.GetTeamName())
            {
            case (int)Team.red:
                teamRed = new List <Transform>(teamController.GetCurrentChipmunksCount());
                teamController.GetCurrentChipmunks(teamRed);
                break;

            case (int)Team.blue:
                teamBlue = new List <Transform>(teamController.GetCurrentChipmunksCount());
                teamController.GetCurrentChipmunks(teamBlue);
                break;

            case (int)Team.yellow:
                teamYellow = new List <Transform>(teamController.GetCurrentChipmunksCount());
                teamController.GetCurrentChipmunks(teamYellow);
                break;

            case (int)Team.green:
                teamGreen = new List <Transform>(teamController.GetCurrentChipmunksCount());
                teamController.GetCurrentChipmunks(teamGreen);
                break;
            }
        }
    }