Unity-ImageLoader
Unity-ImageLoader copied to clipboard
Main Thread
My Unity app loads lots of large images from a server, this causes Unity to freeze while decoding and rendering the image becuase this is all done on the main thread.
Does your code still use the main thread to load the images onto textures?
To test have a code like this
void Update() { transform.rotate(Vector3(1,0,0)* Time.deltatime*10); }
Run that while loading several images using your code, see if the object being rotated ever pauses and then resume rotation.
yes, just like #2 said: Texture2D texture = new Texture2D(width, height, TextureFormat.ARGB32, false); texture.LoadImage(data);
It could be done in a thread when decoding and rendering images, but I have no time to do and test it. You can finish this on a new PR. I appreciate that.