private void OnDestroy()
        {
            GameEvents.onGUIApplicationLauncherReady.Remove(onReady);
            GameEvents.onGUIApplicationLauncherUnreadifying.Remove(onUnreadifying);

            for (int i = vessels.Count - 1; i >= 0; i--)
            {
                SEP_VesselSection v = vessels[i];

                if (v == null)
                {
                    continue;
                }

                v.OnDestroy();
            }

            if (window != null)
            {
                Destroy(window);
            }

            if (window_Obj != null)
            {
                Destroy(window_Obj);
            }
        }
Exemple #2
0
        private void OnDestroy()
        {
            instance = null;

            GameEvents.onGUIApplicationLauncherReady.Remove(onReady);
            GameEvents.onGUIApplicationLauncherUnreadifying.Remove(onUnreadifying);
            GameEvents.OnGameSettingsApplied.Remove(onSettingsApplied);
            SEP_Utilities.onExperimentActivate.Remove(onExpActivate);
            SEP_Utilities.onExperimentDeactivate.Remove(onExpDeactivate);

            for (int i = vessels.Count - 1; i >= 0; i--)
            {
                SEP_VesselSection v = vessels.At(i);

                if (v == null)
                {
                    continue;
                }

                v.OnDestroy();
            }

            if (window != null)
            {
                Destroy(window.gameObject);
            }

            if (compactWindow != null)
            {
                Destroy(compactWindow.gameObject);
            }
        }