Esempio n. 1
0
    public void RefreshHudTop(string mort, string assassi)
    {
        GameObject goMort    = GameObject.Find(mort);
        GameObject goAssassi = GameObject.Find(assassi);
        Unidad     unMort    = goMort.GetComponent <Unidad>();
        Unidad     unAssassi = goMort.GetComponent <Unidad>();

        unMort.SetDeaths(unMort.GetDeaths() + 1);
        unAssassi.SetAssassinations(unAssassi.GetAssassinations() + 1);

        GameObject[] playersList = GameObject.FindGameObjectsWithTag("Player");
        AssTeam1 = 0;
        AssTeam2 = 0;

        foreach (GameObject player in playersList)
        {
            CombatSystem cmbtPlayer = player.GetComponent <CombatSystem>();
            Unidad       uPlayer    = player.GetComponent <Unidad>();

            if (cmbtPlayer.GetTeam() == 0)
            {
                AssTeam1 += uPlayer.GetAssassinations();
            }
            else
            {
                AssTeam2 += uPlayer.GetAssassinations();
            }
        }

        netManager.playerHUD.AssMor.text = AssTeam1 + " vs " + AssTeam2;
    }