Exemple #1
0
 public float Damage(float damage)
 {
     health -= damage;
     if (health <= 0.0)
     {
         if (onDeath != null)
         {
             onDeath.Kill();
         }
         else
         {
             Destroy(gameObject);
         }
     }
     return(health);
 }