void Update() { try { IBarcodeReader barcodeReader = new BarcodeReader(); // decode the current frame var result = barcodeReader.Decode(webCam.GetPixels32(), webCam.width, webCam.height); if (result != null) { Debug.Log("DECODED TEXT FROM QR: " + result.Text); ClientNetworkManager.ConnectClient(result.Text); this.enabled = false; } } catch (Exception ex) { Debug.LogWarning(ex.Message); } }
void Update() { camTexture = this.GetComponent <CameraImageCapture>().GetTexture2D(); try { IBarcodeReader barcodeReader = new BarcodeReader(); // decode the current frame var result = barcodeReader.Decode(camTexture.GetPixels32(), camTexture.width, camTexture.height); if (result != null) { Debug.Log("DECODED TEXT FROM QR: " + result.Text); ClientNetworkManager.ConnectClient(result.Text); this.enabled = false; } } catch (Exception ex) { Debug.LogWarning(ex.Message); } }