This code doesn’t work as you’d expect. If you call a Coroutine (an IEnumerator function) without StartCoroutine(), it doesn’t run at all. Your code is 100% equivalent to:
public Texture2D MyLoad(string URL){
WWW www= new WWW(URL);
while(![url]www.isDone[/url]);
return [url]www.texture;[/url]
}
This will freeze your entire game for the duration of the web-request (In fact, I’m surprised that it doesn’t freeze your application indefinately, but that’s probably because www calls are handled in a separate thread these days). This may be okay during startup of your game, but it will be a huge performance spike when used during a game.