// Toggles power for every component connected to the ship public void MainPower(bool toggle) { RefreshModules(); if (toggle) { StopCoroutine("PowerOn"); StartCoroutine(PowerOn(powerOnTime)); } else { if (!quantumDrive || (quantumDrive && quantumDrive.GetCurrentState() == QuantumDrive.QuantumState.Idle)) { if (thrusters) { thrusters.Deactivate(); } if (boosters) { boosters.Deactivate(); } if (assistModule) { assistModule.Deactivate(); } if (quantumDrive) { quantumDrive.Deactivate(); } if (fuelTank) { fuelTank.Deactivate(); } landingGear.Deactivate(); lights.Deactivate(); speedometer.enabled = false; powered = false; Debug.Log("Ship Power Off; All connected modules offline"); } } }