// OnApplicationQuit is called when the game shuts down. void OnApplicationQuit() { this.CancelCalibration(); if (glove != null && glove.IsConnected()) { glove.StopBrakes(); glove.StopBuzzMotors(); glove.Disconnect(); SenseGlove_Debugger.Log("Disconnected the SenseGlove on " + glove.communicator.Address()); } SenseGloveCs.DeviceScanner.CleanUp(); }
/// <summary> Dispose of resources. </summary> private void Dispose() { this.CancelCalibration(); if (glove != null && glove.IsConnected()) { glove.StopBrakes(); glove.StopBuzzMotors(); glove.Disconnect(); SenseGlove_Debugger.Log("Disconnected the SenseGlove on " + glove.communicator.Address()); } this.Disconnect(); }