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; }
private void Update() { if (pauseTimeSeconds > 0f) { pauseTimeSeconds -= Time.deltaTime; return; } _timeToShoot -= Time.deltaTime; if (_timeToShoot <= 0) { _enemyAnimator.Throw(); ShootAtTarget(); _characterAudio.Shoot(); resetShootTime(); onShoot.Invoke(); } }