Ejemplo n.º 1
0
 public void DecreaseHealthBy(float healthDecrement)
 {
     this.health -= healthDecrement;
     if (this.health <= 0)
     {
         // if it's a defender I need to free its position from the grid to be able to spawn again in that position
         if (this.GetComponent <Defenders>())
         {
             defenderSpawner.FreePos(this.transform.position);
         }
         DestroyObject();
     }
 }