示例#1
0
    // Use this for initialization
    IEnumerator Start()
    {
        string image_url = "http://dev1-api.prolifiq.com/muffin/api/calendar/101?month=january";
        var    headers   = new Hashtable();

        headers.Add("Content-Type", "application/json");
        WWW response = new WWW(image_url);

        yield return(response);

        print("got response");
        Debug.Log(response.text);
        r = ImgResponse.CreateFromJSON(response.text);


        for (var i = 0; i < urls.Length; i++)
        {
            resp = new WWW(urls [i]);
            yield return(resp);

            textures [i] = resp.texture;
            if (i == 0)
            {
                timeLeft = 1.5f;
            }
        }
    }
示例#2
0
    IEnumerator Start()
    {
        //GetComponent<Renderer>().material = new Material(Shader.Find("Unlit/Transparent"));
        //GetComponent<Renderer>().material.mainTexture = Resources.Load("screenshot") as Texture;


//		WWW www = new WWW(url);

        //yield return www;
        //GetComponent<Renderer>().material = new Material(Shader.Find("Unlit/Transparent"));

        string image_url = "http://dev1-api.prolifiq.com/muffin/api/calendar/101?month=february";
        var    headers   = new Hashtable();

        headers.Add("Content-Type", "application/json");
        WWW response = new WWW(image_url);

        yield return(response);

        //string dummy = "{image: \"asdf\", status:\"asdf\",ReceivedOn: \"skldfjsdlkf\", RecievedBy: \"sdkfj\"}";

        ImgResponse r = ImgResponse.CreateFromJSON(response.text);

        GetComponent <Renderer>().material             = new Material(Shader.Find("Mobile/Particles/Alpha Blended"));
        GetComponent <Renderer>().material.mainTexture = r.get_texture();

        //GetComponent<Renderer>().material.mainTexture = www.texture;*/
    }
示例#3
0
    IEnumerator Start()
    {
        string image_url = "http://dev1-api.prolifiq.com/muffin/api/hud?message=welcome";
        var    headers   = new Hashtable();

        headers.Add("Content-Type", "application/json");
        WWW response = new WWW(image_url);

        yield return(response);

        ImgResponse r = ImgResponse.CreateFromJSON(response.text);

        GetComponent <Renderer>().material             = new Material(Shader.Find("Mobile/Particles/Alpha Blended"));
        GetComponent <Renderer>().material.mainTexture = r.get_texture();
    }