So I wrote this method:
public static IEnumerator ApplyFromWeb(string url, Texture texture)
{
WWW webLink = new WWW(url);
yield return webLink;
texture = webLink.texture;
}
And calling it like this. But it doesn’t work. Help please!
void Update()
{
if (Input.GetKeyDown(KeyCode.W))
{
StartCoroutine(BWeb.ApplyFromWeb("http://i.imgur.com/1ArJsU7.jpg", lol));
}
if (Input.GetKeyDown(KeyCode.E))
{
GetComponent<MeshRenderer>().material.mainTexture = lol;
}
}