Example #1
0
 public void OnEnergyReceivedCall()
 {
     OnEnergyReceived?.Invoke(GetEnergy());
 }
Example #2
0
 public virtual void ReceiveEnergy(int amount, NetworkIdentity sender)
 {
     _componentData.ReceiveEnergy(amount, sender, this);
     OnEnergyReceived?.Invoke(GetEnergy());
 }
Example #3
0
 public virtual void ReceiveEnergy(int amount)
 {
     _componentData.ReceiveEnergy(amount, GetOwner(), this);
     OnEnergyReceived?.Invoke(GetEnergy());
 }
Example #4
0
        public void SetEnergy(int energy)
        {
            _energy = Math.Min(energy, _componentData.EnergyCap);

            OnEnergyReceived?.Invoke(GetEnergy());
        }