예제 #1
0
        public void OnDestroy()
        {
            if (RotationChannel != null)
            {
                RotationChannel.Remove(vesselRotationCallback);
            }
            if (TranslationChannel != null)
            {
                TranslationChannel.Remove(vesselTranslationCallback);
            }
            if (WheelChannel != null)
            {
                WheelChannel.Remove(wheelCallback);
            }
            if (ThrottleChannel != null)
            {
                ThrottleChannel.Remove(throttleCallback);
            }
            if (AutopilotChannel != null)
            {
                AutopilotChannel.Remove(autopilotModeCallback);
            }

            FlightGlobals.ActiveVessel.OnPostAutopilotUpdate -= AutopilotUpdater;
        }
예제 #2
0
        public void OnDestroy()
        {
            if (RotationChannel != null)
            {
                RotationChannel.Remove(vesselRotationCallback);
            }
            if (TranslationChannel != null)
            {
                TranslationChannel.Remove(vesselTranslationCallback);
            }
            if (WheelChannel != null)
            {
                WheelChannel.Remove(wheelCallback);
            }
            if (ThrottleChannel != null)
            {
                ThrottleChannel.Remove(throttleCallback);
            }
            if (CustomAxisChannel != null)
            {
                CustomAxisChannel.Remove(customAxisCallback);
            }
            if (AutopilotChannel != null)
            {
                AutopilotChannel.Remove(autopilotModeCallback);
            }

            KSPit.RemoveToDeviceHandler(SASInfoProvider);

            lastActiveVessel.OnPostAutopilotUpdate -= AutopilotUpdater;
            GameEvents.onVesselChange.Remove(OnVesselChange);
        }