public static PlayerEnergyChangeEventArgs Create(float lastEnergy, float currentEnergy, object userData = null)
        {
            PlayerEnergyChangeEventArgs playerEnergyChangeEventArgs = ReferencePool.Acquire <PlayerEnergyChangeEventArgs>();

            playerEnergyChangeEventArgs.LastEnergy    = lastEnergy;
            playerEnergyChangeEventArgs.CurrentEnergy = currentEnergy;
            return(playerEnergyChangeEventArgs);
        }
        public void OnPlayerEnergyChange(object sender, GameEventArgs gameEventArgs)
        {
            PlayerEnergyChangeEventArgs ne = (PlayerEnergyChangeEventArgs)gameEventArgs;

            if (ne == null)
            {
                return;
            }

            UpdateEnergyState(ne.CurrentEnergy);
        }
        private void OnPlayerEnergyChange(object sender, GameEventArgs e)
        {
            PlayerEnergyChangeEventArgs ne = (PlayerEnergyChangeEventArgs)e;

            if (ne == null)
            {
                return;
            }

            energyText.text = ne.CurrentEnergy.ToString();
        }