public void TakeMoney() { if (this.tag == "BuildMissile") { player.ChangeMoney(-200); } else if (this.tag == "BuildKinetic") { player.ChangeMoney(-150); } else if (this.tag == "BuildLaser") { player.ChangeMoney(-300); } }
public void TakeDamage(float damage) { health -= damage; healthBar.fillAmount = health / startHealth; if (health <= 0) { player.ChangeMoney(50); Destroy(enemy); } }