LoadFromCacheOrDownload does not exist in UnityEngine.WWW

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!

It’s not a constructor so don’t use the ‘new’ keyword. It also only works with AssetBundles and the method takes 3 arguments, not 1. I suggest reading the documentation on the method - http://docs.unity3d.com/Documentation/ScriptReference/WWW.LoadFromCacheOrDownload.html