public void Boom(float damage, Weapon.DamageType type) { switch (type) { case Weapon.DamageType.TYPE_EXPLOSION: damage /= 2; break; case Weapon.DamageType.TYPE_KINETIC: damage *= 2; break; } m_Shild.m_Energy = Mathf.Max(0, m_Shild.m_Energy - damage); if (m_Shild.m_Energy <= 0) { gameObject.SetActive(false); } }