public void DecodeQR() { if (!isWorking || !isReadyForRead || previewctr.devicecamera.Width() < 100) { return; } try { dataColor = previewctr.devicecamera.GetCenterPixels32(); // get the camera pixels scanWidth = previewctr.devicecamera.centerBlockWidth; scanHeight = previewctr.devicecamera.centerBlockWidth; CodeDecodeThread.RunAsync(() => { try { data = barReader.Decode(dataColor, scanWidth, scanHeight); //start decode } catch (Exception e) { } }); isReadyForRead = false; } catch (Exception e) { //Log.Error(e); } }
void Awake() { if (_current != null && _current != this) { Destroy(gameObject); } else { _current = this; } }