Example #1
0
 public void damage(float hitPoints)
 {
     health -= hitPoints;
     if (health <= 0)
     {
         GameObject exp = Instantiate(deathExplosion);
         exp.transform.position = new Vector3(transform.position.x, transform.position.y, transform.position.z);
         spawnExp();
         MaxItemsManager.destroyLootCrate(rarityLevel);
         Destroy(gameObject);
     }
 }