Unity-ImageLoader icon indicating copy to clipboard operation
Unity-ImageLoader copied to clipboard

用于Unity中的图片异步显示加载库 async load and display image in unity

Results 2 Unity-ImageLoader issues
Sort by recently updated
recently updated
newest added

Texture2D texture = new Texture2D(width, height, TextureFormat.ARGB32, false); texture.LoadImage(data); 纹理创建和纹理数据载入不能在子线程中做,只能在主线程。一旦下载的图片是png、jpg等格式,LoadImage内部会解码元数据格式到ARGB32,这个是比较花费CPU的,所以图片多一些的时候,卡顿会很明显。好一点的做法考虑在收到http下载的图片数据后。自己写一个解码图片的函数在线程中计算解码。然后在主线程中把解码后的数据直接通过SetPixels或LoadRawTextureData。这样会减少卡顿。

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...