Esempio n. 1
0
    private void OnShootActionCancelled(InputAction.CallbackContext ctx)
    {
        if (_shotProgressBar.currentFill > 0.1f)
        {
            _shooter.Shoot(_shotProgressBar.currentFill);
            _playerAnimator.Shoot();
            _playerAudio.Shoot();
        }
        else
        {
            _playerAnimator.Walk();
        }
        _shotProgressBar.StopAndReset();

        _isSwinging = false;
    }
Esempio n. 2
0
    private void Update()
    {
        if (pauseTimeSeconds > 0f)
        {
            pauseTimeSeconds -= Time.deltaTime;
            return;
        }

        _timeToShoot -= Time.deltaTime;

        if (_timeToShoot <= 0)
        {
            _enemyAnimator.Throw();
            ShootAtTarget();
            _characterAudio.Shoot();
            resetShootTime();
            onShoot.Invoke();
        }
    }