Ejemplo n.º 1
0
 public void Damage(float force)
 {
     // calculate damage
     Debug.Log("damage force: " + force);
     this.health -= (int)(force * damageMultiplier);
     foreach (GameObject healthDisplay in healthDisplays)
     {
         healthDisplay.GetComponent <HealthRenderer>().RenderHealth(health / (float)maxHealth);
     }
     if (this.health <= 0)
     {
         Die dieScript = this.gameObject.GetComponent <Die>();
         dieScript.DieNow();
     }
 }