//------------------------------------------------------------------------------------------------------------- public void GetTinyQRCode(ShowMyAppDelegateQRCode sDelegate) { if (TinyQRCodeRequest == false) { TinyQRCodeRequest = true; StartCoroutine(GetTinyQRCodeAsync(sDelegate)); } }
//------------------------------------------------------------------------------------------------------------- #region Get QRCode public void GetQRCode(ShowMyAppDelegateQRCode sDelegate) { if (Tiny == true) { GetTinyQRCode(sDelegate); } else { GetFullQRCode(sDelegate); } }
//------------------------------------------------------------------------------------------------------------- private IEnumerator GetTinyQRCodeAsync(ShowMyAppDelegateQRCode sDelegate) { string tURI = website + "qrcode.php?t=1&" + GetParam(); Debug.Log("GetTinyQRCodeAsync() => tURI = " + tURI); UnityWebRequest www = UnityWebRequestTexture.GetTexture(tURI); yield return(www.SendWebRequest()); if (www.isNetworkError || www.isHttpError) { Debug.Log(www.error); } else { TinyQRCode = ((DownloadHandlerTexture)www.downloadHandler).texture; sDelegate?.Invoke(TinyQRCode); } TinyQRCodeRequest = false; }