void OnDisable()
 {
     if (Device != null)
     {
         Device.Dispose();
     }
     Device = null;
 }
    void OnEnable()
    {
        if (DeviceIndex >= 0)
        {
            var DeviceNames = PopCameraDevice.EnumCameraDevices();
            DeviceName = DeviceNames[DeviceIndex].Serial;
        }

        Device = new PopCameraDevice.Device(DeviceName, Format);
    }