public void TakeDamage(float amount) { // Adjust the tank's current health, update the UI based on the new health and check whether or not the tank is dead. if (m_CanTakeDamage == false) { return; } m_CurrentHealth -= amount; m_Score.AddDamageTaken(amount); SetHealthUI(); if (m_CurrentHealth <= 0f && !isDead) { OnDeath(); } }