public void UpdateWeaponState(PlayerInput.Input input) { PrimaryWeapon.UpdateState(); if (input.Shoot) { PrimaryWeapon.TryFire(); } else { PrimaryWeapon._isTriggerReleased = true; } if (input.Aim) { PrimaryWeapon.Aim(); } else if (input.Reload) { PrimaryWeapon.BeginReload(); } else if (input.Melee) { //Melee(); } if (input.Shift) { ChangeWeapons(); } }
public void Fire() { if (Time.timeScale == 0) { return; } if (primaryWeapon != null) { primaryWeapon.TryFire(); } foreach (var weapon in weapons) { weapon.TryFire(); } }