private void OnDestroy()
 {
     force0.Close();
     force1.Close();
     force2.Close();
     magnet3.Close();
     magnet4.Close();
     magnet5.Close();
 }
 public VoltageReader(int channel, Action <double> onNewVoltage, int dataIntervalMs = 10)
 {
     this.dataIntervalMs = dataIntervalMs;
     this.NewVoltage    += onNewVoltage;
     input         = new VoltageRatioInput();
     input.Channel = channel;
     input.Close();
     input.Open();
     input.Attach += OnAttach;
 }
 void OnDestroy()
 {
     // IMPORTANT: You must remember to close your Phidgets before ending the game! Otherwise, the next time you try to
     // grab any Phidget that was not closed, your program may freeze (the Unity editor often does).
     dial.Close();
     thumbstickX.Close();
     thumbstickY.Close();
     thumbstickZ.Close();
     touch.Close();
     slider.Close();
     turn10.Close();
     magnet.Close();
 }
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            dcmotor.VelocityUpdate -= onVelocityUpdate;
            dcmotor.Close();
            dcmotor = null;
            vol.VoltageRatioChange -= onVoltageRatioChange;
            vol.Close();
            vol = null;

            Application.Quit();
        }
    }
Example #5
0
 private void OnApplicationQuit()
 {
     ratio.Close();
     StopClient();
 }
Example #6
0
 private void OnApplicationQuit()
 {
     ratio.Close();
     networkConnector.StopBroadcast();
 }