예제 #1
0
    void updateHUD()
    {
        player = GameObject.FindGameObjectWithTag("Player");
        enemy  = GameObject.FindGameObjectWithTag("Ennemy");

        if (player.name == "FedorP1(Clone)" || player.name == "FedorP1skin(Clone)")
        {
            Fedor1.SetActive(true);
            Natalya1.SetActive(false);
            Marcus1.SetActive(false);
        }
        else if (player.name == "NataliaP1(Clone)" || player.name == "NataliaP1skin(Clone)")
        {
            Fedor1.SetActive(false);
            Natalya1.SetActive(true);
            Marcus1.SetActive(false);
        }

        if (enemy.name == "FedorEnemy(Clone)" || enemy.name == "FedorSkinEnemy(Clone)")
        {
            Fedor2.SetActive(true);
            Natalya2.SetActive(false);
            Marcus2.SetActive(false);
        }
        else if (enemy.name == "NataliaEnemy(Clone)" || enemy.name == "NataliaSkinEnemy(Clone)")
        {
            Fedor2.SetActive(false);
            Natalya2.SetActive(true);
            Marcus2.SetActive(false);
        }
    }
예제 #2
0
 void updateHUD()
 {
     players = GameObject.FindGameObjectsWithTag("Player");
     foreach (GameObject pl in players)
     {
         if (pl.layer == 8)
         {
             if (pl.name == "FedorP1(Clone)" || pl.name == "FedorP1skin(Clone)")
             {
                 Fedor1.SetActive(true);
                 Natalya1.SetActive(false);
                 Marcus1.SetActive(false);
             }
             else if (pl.name == "NataliaP1(Clone)" || pl.name == "NataliaP1skin(Clone)")
             {
                 Fedor1.SetActive(false);
                 Natalya1.SetActive(true);
                 Marcus1.SetActive(false);
             }
             else if (pl.name == "MarcusP1(Clone)" || pl.name == "MarcusP1skin(Clone)")
             {
                 Fedor1.SetActive(false);
                 Natalya1.SetActive(false);
                 Marcus1.SetActive(true);
             }
         }
         else
         {
             if (pl.name == "FedorP2(Clone)" || pl.name == "FedorP2skin(Clone)")
             {
                 Fedor2.SetActive(true);
                 Natalya2.SetActive(false);
                 Marcus2.SetActive(false);
             }
             else if (pl.name == "NataliaP2(Clone)" || pl.name == "NataliaP2skin(Clone)")
             {
                 Fedor2.SetActive(false);
                 Natalya2.SetActive(true);
                 Marcus2.SetActive(false);
             }
             else if (pl.name == "MarcusP2(Clone)" || pl.name == "MarcusP2skin(Clone)")
             {
                 Fedor2.SetActive(false);
                 Natalya2.SetActive(false);
                 Marcus2.SetActive(true);
             }
         }
     }
 }