public void JsonVideo(string Data, DetailedCtrl detailedData) { JsonData jsonData = JsonMapper.ToObject(Data); VideoURL = jsonData["trailers"][0]["resource_url"].ToString(); detailedData.video.url = VideoURL; }
IEnumerator GetVideo(string URL, DetailedCtrl detailedData) { WWW www = new WWW(URL); yield return(www); if (www.isDone) { VideoData = www.text; JsonVideo(VideoData, detailedData); } }
public void Click() { DetailedData = UIChange.instance.DetailedData; DetailedData.SetActive(true); DetailedCtrl detailedData = DetailedData.GetComponent <DetailedCtrl>(); StartCoroutine(GetVideo("http://api.douban.com/v2/movie/subject/" + id + "?apikey=0b2bdeda43b5688921839c8ecb20399b&city=%E5%8C%97%E4%BA%AC&client=&udid=", detailedData)); detailedData.Title.text = Title.text; detailedData.Titles.text = Title.text; detailedData.Time.text = year; for (int i = 0; i < genres.Count; i++) { detailedData.Type.text += genres[i] + " "; } detailedData.longTime.text = durations; detailedData.URL = alt; detailedData.Average.text = average; detailedData.AddOnclick(); int numType = 0; print(casts_name.Count); if (casts_name.Count == 1) { numType = 0; } else { numType = 1; } StartCoroutine(detailedData.DownImag(images, numType)); for (int i = 0; i < casts_img.Count; i++) { detailedData.Casts(casts_img[i], casts_name[i], casts_alt[i]); } for (int i = 0; i < directors_name.Count; i++) { detailedData.Directors(directors_img[i], directors_name[i], directors_alt[i]); } }