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

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

        canShoot = true;
    }