private void Shoot() { if (isReloading) { return; } ProcessRaycast(); ammo.DecreaseAmmo(ammoType, ammoPerShot); UpdateWeaponUI(); StartCoroutine(Reload()); }
IEnumerator Shoot() { canShoot = false; PlayMuzzleFlash(); ProcessRaycast(); AudioSource.PlayClipAtPoint(shotSFX, transform.position); ammoSlot.DecreaseAmmo(ammoType); yield return(new WaitForSeconds(timeBetweenShots)); canShoot = true; }