public void TakeDamage(int damage) { damage -= armor.GetValue(); damage = Mathf.Clamp(damage, 0, int.MaxValue); currentHealth -= damage; postProcessingController.UpdatePostProcessing(); Debug.Log(transform.name + " takes " + damage + " damage."); if (currentHealth <= 0) { Die(); } void Die() { sceneSwitcher.GameOver(); Debug.Log(transform.name + " died."); } }