private void OnDestroy() { if (Instance != null) { if (Instance == this) { Instance = null; } } InputLockManager.RemoveControlLock("BeenThereDoneThatQuickLaunchMissionDialog"); FlightDriver.SetPause(false, true); }
public static QuickLaunchMissionDialog Create(Callback onDismissCallback, QuickLaunchVessel quickLaunchVessel, Vessel vessel) { GameObject gameObject = new GameObject("BeenThereDoneThat mission start menu"); QuickLaunchMissionDialog quickLaunchMissionDialog = gameObject.AddComponent <QuickLaunchMissionDialog>(); quickLaunchMissionDialog.onDismissCallback = onDismissCallback; quickLaunchMissionDialog.skin = UISkinManager.GetSkin("MainMenuSkin"); quickLaunchMissionDialog.quickLaunchVessel = quickLaunchVessel; quickLaunchMissionDialog.vessel = vessel; quickLaunchMissionDialog.selectedMissionIndex = -1; return(quickLaunchMissionDialog); }
public void OnQuickLaunchMission(Vessel vessel) { LaunchVehicle launchVehicle = null; Payload payload = null; if (!QuickLauncher.Instance.Split(vessel.parts, out launchVehicle, out payload)) { ScreenMessages.PostScreenMessage("No payload separator available", 4, ScreenMessageStyle.UPPER_CENTER); return; } int key = launchVehicle.GetHashCode(); if (!quickLaunchVessels.ContainsKey(key)) { ScreenMessages.PostScreenMessage("No missions available", 4, ScreenMessageStyle.UPPER_CENTER); return; } QuickLaunchVessel quickLaunchVessel = quickLaunchVessels[key]; quickLaunchMissionDialog = QuickLaunchMissionDialog.Create(OnQuickLaunchDialogDismissed, quickLaunchVessel, vessel); }
public void Awake() { Instance = this; FlightDriver.SetPause(true, true); InputLockManager.SetControlLock("BeenThereDoneThatQuickLaunchMissionDialog"); }
public void OnQuickLaunchDialogDismissed() { quickLaunchMissionDialog = null; }