Example #1
0
        private IEnumerator ReloadWeapon(Unit.UnitController unit)
        {
            BulletsQuantityUnit bulletsQuantity = unit.bulletsQuantity;
            ShootingCheck       shootingCheck   = unit.shootingCheck;
            Animator            animator        = unit.animator;

            //m_LinkManager.shootingController.StopAllCoroutines();

            shootingCheck.DisableShooting();
            shootingCheck.isShoot  = false;
            shootingCheck.isNoAmmo = true;
            shootingCheck.StopAllCoroutines();

            animator.SetTrigger("ReloadGun");

            m_AudioSource.PlayOneShot(m_SoundReload);

            yield return(new WaitForSeconds(bulletsQuantity.currentWeapon.ReloadTime));

            if (!bulletsQuantity.currentWeapon.InfinityBullets)
            {
                bulletsQuantity.allBulletsWeapon -= bulletsQuantity.defaultBulletsInClip;
            }

            m_AudioSource.Stop();

            bulletsQuantity.quantityBulletsInClip = bulletsQuantity.defaultBulletsInClip;

            SetUIWeaponParameters(unit);
            shootingCheck.isNoAmmo = false;
            shootingCheck.isShoot  = true;
        }
Example #2
0
 public void ShootEnd()
 {
     shootingCheck.DisableShooting();
 }