Пример #1
0
    IEnumerator WeaponShoot()
    {
        if (ammoSlot.GetAmmo(ammoType) > 0)
        {
            shotAnim.SetTrigger(FIRE_ANIMATION_TRIGGER);
            muzzleFlash.Play();
            AudioSource.PlayClipAtPoint(audioClip, Camera.main.transform.position, 1f);
            WeaponRaycast();
            ammoSlot.ReduceAmmo(ammoType);
            yield return(new WaitForSeconds(shotsDelay));

            muzzleFlash.Stop();
        }
    }