string url = <path>;
www = new WWW (url);
yield return www;
image.sprite = Sprite.Create (www.texture, new Rect (0, 0, www.texture.width, www.texture.height), new Vector2 (0, 0));
I use the above code to load image file into UI image sprite.
I have to load about 200 images to each sprite on start of application.
In editor it can run just fine, but in build version it crash while loading of the image files.
The reason to load image from local is so I can just edit the image on local, and the application will load the new image.
I can tell it crash because of the leak of memory(Because it is some very large images), also checked it does use up all the memorys.
Is there anyway to load local image to sprite and clean the memory after, but still show on image.sprite?
I mean anyway that I can load local images to image.sprite is good to me.
Thanks