diff --git a/Src/NFTWallet/Assets/Code/NFTWallet/Windows/MarketplaceWindow.cs b/Src/NFTWallet/Assets/Code/NFTWallet/Windows/MarketplaceWindow.cs index 58eea0b..3ce76e8 100644 --- a/Src/NFTWallet/Assets/Code/NFTWallet/Windows/MarketplaceWindow.cs +++ b/Src/NFTWallet/Assets/Code/NFTWallet/Windows/MarketplaceWindow.cs @@ -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);