public void OnDestroy() { DebugHelper.Debug("EngineFlightControl:OnDestroy"); GameEvents.onGUIApplicationLauncherReady.Remove(OnGUIAppLauncherReady); ApplicationLauncher.Instance.RemoveModApplication(_appLauncherButton); //GameEvents.onVesselChange.Remove(OnVesselWasModified); GameEvents.onVesselWasModified.Remove(OnVesselWasModified); _gui.RenderEnabled = false; Instance = null; _gui = null; _framework = null; }
public void OnDestroy() { DebugHelper.Debug("EngineFlightControl:OnDestroy"); GameEvents.onGUIApplicationLauncherReady.Remove(OnGUIAppLauncherReady); ApplicationLauncher.Instance.RemoveModApplication(_appLauncherButton); //GameEvents.onVesselChange.Remove(OnVesselWasModified); GameEvents.onVesselWasModified.Remove(OnVesselWasModified); _gui.EndPostDisplay(); Instance = null; _gui = null; _framework = null; }
public void Start() { DebugHelper.Debug("EngineFlightControl:Start"); _framework = new GUIFramework(); _gui = new EngineFlightUI("Engine Groups Controller", _framework); _gui.IsDisplayDelegate += () => _displayGUI; Instance = this; OnVesselWasModified(FlightGlobals.ActiveVessel); //GameEvents.onVesselChange.Add(OnVesselWasModified); GameEvents.onVesselWasModified.Add(OnVesselWasModified); _gui.StartPostDisplay(1); GameEvents.onGUIApplicationLauncherReady.Add(OnGUIAppLauncherReady); }