public void OnDestroy()
 {
     MonoBehaviour.print("SSTUReflectionManager OnDestroy()");
     if (instance == this)
     {
         instance = null;
     }
     if (vesselCreateEvent != null)
     {
         GameEvents.onVesselCreate.Remove(vesselCreateEvent);
     }
     if (vesselDestroyedEvent != null)
     {
         GameEvents.onVesselDestroy.Remove(vesselDestroyedEvent);
     }
     if (gui != null)
     {
         GameObject.Destroy(gui);
         gui = null;
     }
     if (debugSphere != null)
     {
         GameObject.Destroy(debugSphere);
         debugSphere = null;
     }
     //TODO proper resource cleanup
     //TODO do materials and render textures need to be released?
 }
 public void OnDestroy()
 {
     if (instance == this)
     {
         instance = null;
     }
     if (gui != null)
     {
         GameObject.Destroy(gui);
         gui = null;
     }
     if (debugSphere != null)
     {
         GameObject.Destroy(debugSphere);
         debugSphere = null;
     }
     //TODO proper resource cleanup
     //TODO do materials and render textures need to be released?
 }
 public void debugGuiDisable()
 {
     GameObject.Destroy(gui);
     gui = null;
 }
 private void debugGuiEnable()
 {
     gui = gameObject.AddComponent <ReflectionDebugGUI>();
 }