using UnityEngine; using System; // Gate.cs public class Gate : MonoBehaviour, IDamageable { [SerializeField] private float maxHealth = 50f; private float _currentHealth; void Awake() => _currentHealth = maxHealth; public void TakeDamage(float amount) { _currentHealth -= amount; if (_currentHealth <= 0) gameObject.SetActive(false); } }