public override void RequestToReload() { if (!HasActiveCooldown() && !clip.IsFull()) { Reload(); } }
protected override IEnumerator <float> _Reload(IClip clip, Func <int> getReserveAmmo, Action <int> callback) { while (true) { yield return(Timing.WaitForSeconds(reloadDurationPerPump)); if (getReserveAmmo() <= 0) { yield break; } int ammoUsed = clip.TryFillAmmo(Mathf.Min(getReserveAmmo(), ammoReloadedPerPump)); callback(ammoUsed); if (clip.IsFull()) { yield break; } } }