Hi, I try to load an image from an url (as texture of an 3D object).
In Unity it works but in the webplayer it don’t
What can i do?
public Texture2D TextureTemplate;
// Use this for initialization
void Start () {
StartCoroutine(DownloadAdd1("http://www.mywebsite.com/3d/upload/TestTemplate1.png"));
}
// Update is called once per frame
void Update () {
}
IEnumerator DownloadAdd1(string url)
{
Texture2D texture = new Texture2D(40, 40, TextureFormat.DXT1, false);
WWW www = new WWW(url);
yield return www;
www.LoadImageIntoTexture(texture);
TextureTemplate = texture;
this.GetComponent<Renderer>().material.mainTexture = TextureTemplate;
}
}