How to load content from a remote json file to Unity 5?

Asked

Viewed 68 times

2

I have 60 urls, but www.text only returns me 45. I have no errors.

Below is my code.

public class LoadPhoto : MonoBehaviour {

     private string LinkJsonFile = "http://www.bollyshake.com/api/1/video/trending?page=2&per_page=60";
     void Start () {
         position = 0;
         StartCoroutine(UploadImages(LinkJsonFile));
     }

     IEnumerator UploadImages (string LinkJsonFile)
    {
        string aux = "";
        WWW www = new WWW (LinkJsonFile);
        yield return new WaitForSeconds(5);
        if (www.isDone) {
            aux = www.text;
            print (aux);
            if (www.text == null) {
                Debug.Log ("Url de images são nulas");
            }
        }

    }

}

There’s another way to do it ?

Thanks for your help.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.