Ejemplo n.º 1
0
    IEnumerator DownloadPhoto(string url)
    {
        UnityWebRequest request = UnityWebRequestTexture.GetTexture(url);

        yield return(request.SendWebRequest());

        if (request.isNetworkError || request.isHttpError)
        {
            Debug.Log(request.error);
        }
        else
        {
            photo.texture = ((DownloadHandlerTexture)request.downloadHandler).texture;
        }

        numberObject.GetComponent <Text>().text  = number;
        websiteObject.GetComponent <Text>().text = website;

        Debug.Log("Finished Downloading Photo");
        LoadingIndicator.SetActive(false);
    }