示例#1
0
    public void JsonVideo(string Data, DetailedCtrl detailedData)
    {
        JsonData jsonData = JsonMapper.ToObject(Data);

        VideoURL = jsonData["trailers"][0]["resource_url"].ToString();
        detailedData.video.url = VideoURL;
    }
示例#2
0
    IEnumerator GetVideo(string URL, DetailedCtrl detailedData)
    {
        WWW www = new WWW(URL);

        yield return(www);

        if (www.isDone)
        {
            VideoData = www.text;
            JsonVideo(VideoData, detailedData);
        }
    }
示例#3
0
    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]);
        }
    }