using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Events; public class EnergyController : MonoBehaviour { [SerializeField] private float _energy; public event UnityAction OnEnergyChange; public float Energy { get => _energy; set { _energy = value; OnEnergyChange?.Invoke(_energy); } } }