Hi,
I have a UI background image and when a button is pressed the background image is changed to an image found within a folder, the problem is if the image is decent-high quality the game will freeze for a few frames (seen in the profiler).
Is there a better way of doing this? At the moment I’m using LoadImageIntoTexture (image file path)
// Load the image
IEnumerator LoadImg()
{
yield return 0;
WWW imgLink = new WWW("file://" + completePath);
yield return imgLink;
imgLink.LoadImageIntoTexture(img.mainTexture as Texture2D);
}