Ejemplo n.º 1
0
 void TakeDamage(float damage)
 {
     damageText.CreateText(damage, transform);
     if (damage >= health)
     {
         mission.AddKill();
         Destroy(Instantiate(explosion, transform.position, Quaternion.identity), 1f);
         Destroy(this.gameObject);
     }
     else
     {
         health -= damage;
     }
     healthSlider.UpdateSlider();
 }