Ejemplo n.º 1
0
 void Fire(Vector3 fireDirection)
 {
     StartCoroutine(Cooldown(activeWeapon.GetFireDelay()));
     activeWeapon.Fire(fireDirection, playerCamera);
     OnFire.Invoke();
     sfx.PlayRandomAudioOneshot(activeWeapon.gunshotSFX, 0.7f, 1f, 0.9f, 1.1f);
 }
Ejemplo n.º 2
0
    private void Shoot()
    {
        var isFired = _currentWeapon.Fire();

        if (isFired)
        {
            if (isCrouching)
            {
                animController.Shoot(false);
            }
            else
            {
                animController.Shoot(true);
            }
            _currentHandWeapon.Shoot();

            // check hit
            combatController.CheckHit(_camera);
        }
    }