public void FireSpecialWeapon(float DT, bool IsFiringSpecial) { if (IsFiringSpecial) { CurrentSepcialWeapon = DesiredSpecialWeapon; switch (CurrentSepcialWeapon) { case "": break; case "ShotGun": ShotGun.Fire(DT, IsFiringSpecial); break; case "RPG": rocket.Fire(DT, IsFiringSpecial); break; case "Laser": Laser.Fire(IsFiringSpecial); break; } } }
void Update() { if (Input.GetButtonUp("Cancel")) { SceneManager.LoadScene("MainMenu"); } bool m1Down = Input.GetButton("Fire1"); if (m1Down && gun) { gun.Fire(); } UpdateRBGravity(m1Down); UpdateGunPositionAndRotation(); if (Input.GetButtonDown("Fire2")) { PickUpGun(rl); UpdateGunPositionAndRotation(); rl.Fire(); PickUpGun(m4); } animator.SetFloat("speed", rb.velocity.x); lastHandSwitch += Time.deltaTime; lastDeathTime += Time.deltaTime; }
void Update() { if (!ship.free) //No firing guns if the game is paused or the round is over. { return; } if (Input.GetButton("Fire1")) { blaster.Fire(); } if (Input.GetButton("Fire2") && rocketLauncher.ammo > 0) { rocketLauncher.Fire(); } }
// Update is called once per frame void Update() { switch (state) { case BossState.Targeting: TargetLogic(); break; case BossState.LockedOn: LockedOnLogic(); break; case BossState.Attacking: AttackingLogic(); break; case BossState.Stuck: StuckLogic(); break; case BossState.Shaking: ShakeLogic(); break; case BossState.CoolingDown: CoolDownLogic(); break; } if (state != BossState.Stuck && state != BossState.Shaking && _KockOff) { exitState(); state = BossState.Shaking; } if (state != BossState.Stuck) { _rocketTimer += Time.deltaTime; if (_rocketTimer >= rocketCD) { _rocketTimer = 0; launcher.Fire(lockOnTarget); } } _playerOn = false; }