// Update is called once per frame void Update() { if (Input.GetKey(KeyCode.C)) { _primaryGun.Shoot(); } }
protected void WeaponInputs() { if (Input.GetMouseButton(1)) { if (!gun.isAiming) { gun.StartAiming(); } else { if (gun.automatic && Input.GetMouseButton(0)) { gun.Shoot(); } else if (Input.GetMouseButtonDown(0)) { gun.Shoot(); } } } else if (gun.isAiming) { gun.StopAiming(); } if (Input.GetKeyDown(KeyCode.R)) { if (gun.CanAttemptFastReload()) { gun.AttemptFastReload(); } else if (gun.CanReload()) { gun.StartReload(); } } }
private void UseWeapon() { if (holdingItem != null && MOVER_FLAGS.isShooting) { switch (holdingItem.GetType().ToString()) { case "GunBase": GunBase holdingGun = holdingItem as GunBase; holdingGun.Shoot(); break; case "MeleeBase": MeleeBase holdingMelee = holdingItem as MeleeBase; holdingMelee.Hit(); break; } } }
private void FixedUpdate() { _gun.Shoot(); _transform.position = Vector3.MoveTowards(_transform.position, _transform.position + _direction * _speed * Time.fixedDeltaTime, _speed); }