예제 #1
0
 public void restarVida(int damage)
 {
     if (!dead)
     {
         hearts           -= damage;
         numVidasText.text = "Vidas: " + hearts;
         Debug.Log(hearts);
         if (hearts <= 0)
         {
             hearts = 3;
             dead   = true;
             Respawn();
         }
         else
         {
             gameInvulnerable.StartCoroutine("GetInvulnerable");
         }
     }
 }