Ejemplo n.º 1
0
 // Update is called once per frame
 void Update()
 {
     if (_animator.GetBool("isDead") || !CanMove)
     {
         return;
     }
     ProccesInput();
     ChangeInputFromMultipleKeyPresses();
     Move();
     if (_lastShootTimer > ShootCooldown && Input.GetButton("P" + Player + "Fire"))
     {
         _gun.Shoot(Player);
         _audio.clip = ShootingAudioClips[Random.Range(0, ShootingAudioClips.Count)];
         _audio.Play();
         _lastShootTimer = 0;
     }
     _lastShootTimer += Time.deltaTime;
 }
Ejemplo n.º 2
0
    /**** Combat controls ****/
    public void OnModeSwitch()
    {
        pilotActionMap.Disable();
        gunnerActionMap.Disable();
        combatActionMap.Disable();
        cabinActionMap.Enable();

        if (mode == PlayerMode.GunnerMode)
        {
            Gunner.Shoot(false);
            Gunner.instance.player = null;
        }
        else if (mode == PlayerMode.PilotMode)
        {
            Pilot.instance.player = null;
        }

        mode = PlayerMode.CabinMode;
        //Debug.Log("Mode switched to Cabin");
        ModeManager.ModeSwitch(this, PlayerMode.CabinMode);
    }
Ejemplo n.º 3
0
 public void OnShoot(InputValue axis)
 {
     //Debug.Log("Shot: " + axis.Get());
     Gunner.Shoot((float)axis.Get() > 0);
 }