Exemplo n.º 1
0
    private IEnumerator Shoot()
    {
        canShoot = false;
        if (ammoSlot.GetCurrentAmmo(ammoType) > 0)
        {
            ammoSlot.DecreaseCurrentAmmo(ammoType);
            PlayMuzzleFlash();
            ProcessRaycast();
            UIcanvas.UpdateAmmoDisplay(ammoSlot.GetCurrentAmmo(ammoType));
        }
        yield return(new WaitForSeconds(timeBetweenShots));

        canShoot = true;
    }