Skip to content

Commit

Permalink
Make camera start after permission given
Browse files Browse the repository at this point in the history
  • Loading branch information
madrazzl3 committed Jul 21, 2022
1 parent a943f56 commit 75e695c
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions Src/NFTWallet/Assets/Code/NFTWallet/Windows/MarketplaceWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,19 @@ async void Awake()
});
}

async void Start()
{
webcamTexture = new WebCamTexture(512, 512);
Image.texture = webcamTexture;
}

private IEnumerator GetQRCode()
{
if (webcamTexture == null) {
yield return Application.RequestUserAuthorization(UserAuthorization.WebCam);
if (Application.HasUserAuthorization(UserAuthorization.WebCam))
{
webcamTexture = new WebCamTexture(512, 512);
Image.texture = webcamTexture;
} else {
yield break;
}
}

IBarcodeReader barCodeReader = new BarcodeReader();
webcamTexture.Play();
Texture2D snap = new Texture2D(webcamTexture.width, webcamTexture.height, TextureFormat.ARGB32, false);
Expand Down

0 comments on commit 75e695c

Please sign in to comment.