Ejemplo n.º 1
0
        void OnDestroy()
        {
            //GameEvents.onEditorVariantApplied.Remove(UpdateGeometryEvent); // Rodhern: Downgrade to KSP 1.3.1
            GameEvents.onEditorPartEvent.Remove(UpdateGeometryEvent);
            GameEvents.onEditorUndo.Remove(ResetEditorEvent);
            GameEvents.onEditorRedo.Remove(ResetEditorEvent);
            GameEvents.onEditorShipModified.Remove(ResetEditorEvent);
            GameEvents.onEditorLoad.Remove(ResetEditorEvent);

            GameEvents.onGUIEngineersReportReady.Remove(AddDesignConcerns);
            GameEvents.onGUIEngineersReportDestroy.Remove(RemoveDesignConcerns);

            //EditorLogic.fetch.Unlock("FAREdLock");

            if (blizzyEditorGUIButton != null)
            {
                blizzyEditorGUIButton.Destroy();
                blizzyEditorGUIButton = null;
            }

            _stabDerivLinSim = null;
            _instantSim      = null;
            _areaRulingOverlay.Cleanup();
            _areaRulingOverlay = null;
            _editorGraph       = null;
            _stabDeriv         = null;

            if (_vehicleAero != null)
            {
                _vehicleAero.ForceCleanup();
            }
            _vehicleAero = null;
        }
Ejemplo n.º 2
0
        private void OnDestroy()
        {
            GameEvents.onEditorVariantApplied.Remove(UpdateGeometryEvent);
            GameEvents.onEditorPartEvent.Remove(UpdateGeometryEvent);
            GameEvents.onEditorUndo.Remove(ResetEditorEvent);
            GameEvents.onEditorRedo.Remove(ResetEditorEvent);
            GameEvents.onEditorShipModified.Remove(ResetEditorEvent);
            GameEvents.onEditorLoad.Remove(ResetEditorEvent);

            GameEvents.onGUIEngineersReportReady.Remove(AddDesignConcerns);
            GameEvents.onGUIEngineersReportDestroy.Remove(RemoveDesignConcerns);

            if (blizzyEditorGUIButton != null)
            {
                blizzyEditorGUIButton.Destroy();
                blizzyEditorGUIButton = null;
            }

            _stabDerivLinSim = null;
            _instantSim      = null;
            _areaRulingOverlay.Cleanup();
            _areaRulingOverlay = null;
            _editorGraph       = null;
            _stabDeriv         = null;

            _vehicleAero?.ForceCleanup();
            _vehicleAero = null;
        }