private IEnumerator CheckVesselState() { yield return(new WaitForSeconds(1)); if (FlightGlobals.ActiveVessel.verticalSpeed <= 0) { DebugHelper.WriteMessage("Check Vessel aborted: {0} {1}", FlightGlobals.ActiveVessel.altitude, _defaultAltitude); if (LaunchCountdownConfig.Instance.Info.AbortExecuted) { var vesselParts = FlightGlobals.ActiveVessel.parts; BaseAction.FireAction(vesselParts, KSPActionGroup.Abort, KSPActionType.Activate); } Abort(); } else { DebugHelper.WriteMessage("Check Vessel launched: {0} {1}", FlightGlobals.ActiveVessel.altitude, _defaultAltitude); try { Launched(); } catch (Exception ex) { DebugHelper.WriteMessage(ex.StackTrace); } } }
private IEnumerator Abort() { TimeWarp.SetRate(0, false); var clip = ConfigInfo.Instance.CurrentAudio.Abort; if (GravityTurnAPI.GravityTurnActive) { GravityTurnAPI.Kill(); } holdPlayed = true; if (clip != null) { _audioSource.PlayOneShot(clip); yield return(new WaitForSeconds(clip.length)); } if (ConfigInfo.Instance.AbortExecuted) { BaseAction.FireAction(FlightGlobals.ActiveVessel.Parts, KSPActionGroup.Abort, KSPActionType.Activate); } Machine.RunEvent("Init"); }