RemoteTech.RTCore.OnDestroy C# (CSharp) Method

OnDestroy() public method

Called by the Unity engine during the Decommissioning phase of the Engine. This is used to clean up everything before quiting.
public OnDestroy ( ) : void
return void
        public void OnDestroy()
        {
            if (FocusOverlay != null) FocusOverlay.Dispose();
            if (ManeuverNodeOverlay != null) ManeuverNodeOverlay.Dispose();
            if (FilterOverlay != null) FilterOverlay.Dispose();
            if (Renderer != null) Renderer.Detach();
            if (Network != null) Network.Dispose();
            if (Satellites != null) Satellites.Dispose();
            if (Antennas != null) Antennas.Dispose();

            // Remove GUI stuff
            GameEvents.onShowUI.Remove(UiOn);
            GameEvents.onHideUI.Remove(UiOff);

			// add-ons
            if (KacAddon != null) KacAddon = null;

            Instance = null;
        }