示例#1
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;*/
    }
示例#2
0
    IEnumerator get_image()
    {
        string image_url = "http://dev1-api.prolifiq.com/muffin/api/calendar/101?month=march";
        var    headers   = new Hashtable();

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

        yield return(response);

        ImgResponse r = JsonUtility.FromJson <ImgResponse>(response.text);

        GetComponent <Renderer>().material             = new Material(Shader.Find("Unlit/Transparent"));
        GetComponent <Renderer>().material.mainTexture = r.get_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();
    }