using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Events; public class EnergyController : MonoBehaviour, ITextChangable { [SerializeField] private float _energy; public UnityEvent OnTextChange => _OnTextChange; private UnityEvent _OnTextChange = new UnityEvent(); public float Energy { get => _energy; set { _energy = value; _OnTextChange?.Invoke(_energy); } } }