public void Start() { instance = this; if (!init) { Initialise(); } // register vessel if (FlightData.thisVessel == null) { FlightData.thisVessel = FlightGlobals.ActiveVessel; } PresetManager.loadCraftAsstPreset(); Utils.GetAsst(PIDList.Aileron).InMax = 180; Utils.GetAsst(PIDList.Aileron).InMin = -180; Utils.GetAsst(PIDList.Altitude).InMin = 0; Utils.GetAsst(PIDList.Throttle).InMin = 0; FlightData.thisVessel.OnPostAutopilotUpdate += new FlightInputCallback(vesselController); GameEvents.onVesselChange.Add(vesselSwitch); RenderingManager.AddToPostDrawQueue(5, drawGUI); }
private void vesselSwitch(Vessel v) { FlightData.thisVessel.OnPostAutopilotUpdate -= new FlightInputCallback(vesselController); FlightData.thisVessel = v; FlightData.thisVessel.OnPostAutopilotUpdate += new FlightInputCallback(vesselController); PresetManager.loadCraftAsstPreset(); }