last update
This commit is contained in:
@@ -63,21 +63,24 @@ public class QRCodeReader : MonoBehaviour
|
||||
var ratio = (float)camTexture.width / (float)camTexture.height;
|
||||
aspectRatioFitter.aspectRatio = ratio;
|
||||
|
||||
float scaleY = 1;
|
||||
float scaleY = -1;
|
||||
if(Application.platform == RuntimePlatform.Android)
|
||||
{
|
||||
scaleY = camTexture.videoVerticallyMirrored ? -1f : 1f;
|
||||
rawImage.rectTransform.localScale = new Vector3(1f, scaleY, 1f);
|
||||
}
|
||||
else
|
||||
{
|
||||
ratio = (float)camTexture.height / (float)camTexture.width;
|
||||
rawImage.rectTransform.localScale = new Vector3(1f, -1f, 1f);
|
||||
}
|
||||
|
||||
rawImage.rectTransform.localScale = new Vector3(1f, scaleY, 1f);
|
||||
|
||||
ScanningQRCode();
|
||||
}
|
||||
|
||||
// void Update()
|
||||
// {
|
||||
// cameraCrop = new Texture2D(camTexture.width, camTexture.height);
|
||||
// cameraCrop.SetPixels32(camTexture.GetPixels32());
|
||||
// cameraCrop.Apply();
|
||||
|
||||
// cropImage.texture = cameraCrop;
|
||||
// }
|
||||
|
||||
public void ScanningQRCode()
|
||||
{
|
||||
if(c_QRScanningRoutine != null)
|
||||
@@ -112,8 +115,6 @@ public class QRCodeReader : MonoBehaviour
|
||||
yield return new WaitForSeconds(.5f);
|
||||
}
|
||||
|
||||
yield return new WaitForSeconds(1);
|
||||
|
||||
if(!loadingCanvas.gameObject.activeSelf)
|
||||
loadingCanvas.gameObject.SetActive(true);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user