Пример #1
0
 void GetPlayersLife()//Get player's life function
 {
     if (this.tag == "Player1")
     {
         PrintLife = GM.GetLifePlayer1().ToString();//get player's life from gamemaneger And set
         if (GM.GetLifePlayer1() != prevLife)
         {
             DoParticle();
             prevLife = GM.GetLifePlayer1();
         }
     }
     if (this.tag == "Player2")
     {
         PrintLife = GM.GetLifePlayer2().ToString();//get player's life from gamemaneger And set
         if (GM.GetLifePlayer2() != prevLife)
         {
             DoParticle();
             prevLife = GM.GetLifePlayer2();
         }
     }
     GetComponent <Text>().text = PrintLife;//change print text
 }