void OnApplicationQuit() { // shut down communication to Xsens if (_masterDevice != null) { _masterDevice.clearCallbackHandlers(); } _measuringMts.Clear(); UnityEngine.Debug.Log("Disable radio"); if (_masterDevice != null) { if (_masterDevice.isRadioEnabled()) { _masterDevice.disableRadio(); } } UnityEngine.Debug.Log("closing connection to MTws"); _xda.Dispose(); _xda = null; // shut down connection to server _client.Close(); }