private IEnumerator CycleShot() { float loadBuffer = 0; if (ammunition.ExpendBullet()) { while (loadBuffer < 1) { loadBuffer += Time.deltaTime * attributes.RateOfFire; anim.SetFloat("cycleProgress", loadBuffer); yield return(null); } isLoaded = true; } else { anim.SetBool("isEmpty", true); isBusy = false; } }