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!
GetComponent<MeshRenderer>().material.mainTexture = lol;
First place log at the last of the Coroutine to check is the texture downloaded properly.
Then check the following steps
I think you have 2 mistakes in your code( I may be wrong but please cross check)
Use Texture 2D instead of Texture
Fist declare a
public texture2D downloadedTex in your ‘BWeb’ script then assign that downloading texture to the ‘downloadedTex’ then
GetComponent().material.mainTexture = BWeb.downloadedTex;
Please check the same and tell us.