protected void CheckForReload() { int currentAmmo = _shootingBehaviour.CurrentWeapon.Ammo; int magazineSize = _shootingBehaviour.CurrentWeapon.MagazineSize; if (currentAmmo == magazineSize) { return; } if (currentAmmo == 0) { _shootingBehaviour.Reload(); } if (State == EnemyState.passive) { _shootingBehaviour.Reload(); } }
private void HandleGeneralInput() { if (Input.GetButtonUp("Fire")) { ShootingBehaviour.Release(); } if (Input.GetButton("Fire")) { if (_swithcTakeOverBehaviour.IsSwitching) { _swithcTakeOverBehaviour.SwitchTakeOver(); } else { ShootingBehaviour.Fire(); } } if (Input.GetButton("Defend")) { _defendingBehaviour.Defend(); } if (Input.GetButtonDown("Reload")) { ShootingBehaviour.Reload(); } if (Input.GetButtonDown("Stealth") && !_takeOverBehaviour.TakenOver) { _stealthBehaviour.ToggleStealth(); } if (Input.GetButtonDown("Interact")) { _interActionBehaviour.Interact(); } if (Input.GetButtonDown("Switch") && _takeOverBehaviour.TakenOver) { _swithcTakeOverBehaviour.Switch(); } }