Hi,
I am creating an iOS Android app that downloads images from my server and displays them as textures on prefabs.
I managed to get everything to work, but I want to improve the performance of my app and cache the images instead of downloading them every time needed. I came across LoadFromCacheOrDownload which seems to be exactly what I need, but when I try to build, I get the error:
This is my code:
public IEnumerator DownloadImage(string url, GameObject tex)
{
Debug.Log("URL: " + url);
WWW www = new WWW.LoadFromCacheOrDownload(url);
yield return www;
tex.renderer.material.mainTexture = www.texture;
Color color = tex.renderer.material.color;
color.a = 1f;
tex.renderer.material.color = color;
}
Can someone explain to be what I am doing wrong, and any suggestions on how to get this to work would be greatly appreciated!