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; }
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; }