示例#1
0
 private void Shoot()
 {
     if (isReloading)
     {
         return;
     }
     ProcessRaycast();
     ammo.DecreaseAmmo(ammoType, ammoPerShot);
     UpdateWeaponUI();
     StartCoroutine(Reload());
 }
示例#2
0
    IEnumerator Shoot()
    {
        canShoot = false;

        PlayMuzzleFlash();
        ProcessRaycast();
        AudioSource.PlayClipAtPoint(shotSFX, transform.position);
        ammoSlot.DecreaseAmmo(ammoType);
        yield return(new WaitForSeconds(timeBetweenShots));

        canShoot = true;
    }