/**** 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); }
/**** Cabin controls ****/ public void OnInteract() { string debugString = "Interacted: "; if (onPilot && Pilot.instance.player == null) { debugString += "Mode switched to Pilot"; cabinActionMap.Disable(); pilotActionMap.Enable(); combatActionMap.Enable(); mode = PlayerMode.PilotMode; cabinMove = Vector2.zero; Pilot.instance.player = this; ModeManager.ModeSwitch(this, PlayerMode.PilotMode); } if (onGunner && Gunner.instance.player == null) { debugString += "Mode switched to Gunner"; cabinActionMap.Disable(); gunnerActionMap.Enable(); combatActionMap.Enable(); mode = PlayerMode.GunnerMode; cabinMove = Vector2.zero; Gunner.instance.player = this; ModeManager.ModeSwitch(this, PlayerMode.GunnerMode); } if (onShield) { //Debug.Log("OnShield"); if (SubsystemManager.shieldHealth < 99) { SubsystemManager.shieldHealth += 2; } else { SubsystemManager.shieldHealth = 100; } //Debug.Log(SubsystemManager.shieldHealth); } if (onWeapons) { //Debug.Log("OnWeapons"); if (SubsystemManager.weaponHealth < 99) { SubsystemManager.weaponHealth += 2; } else { SubsystemManager.weaponHealth = 100; } //Debug.Log(SubsystemManager.weaponHealth); } if (onNavigation) { //Debug.Log("OnNav"); if (SubsystemManager.navigationHealth < 99) { SubsystemManager.navigationHealth += 2; } else { SubsystemManager.navigationHealth = 100; } //Debug.Log(SubsystemManager.navigationHealth); } //Debug.Log(debugString); }