i want to read one texture with sequence, my code is below:
///
/// Dispaly image with a sequence loop.
///
///
IEnumerator DisplayImage()
{
int count = imagepaths.Length;
while (n < count)
{
WWW imagetemp = new WWW("file://D:/Ebook/" + imagepaths[n]);
yield return imagetemp;
Texture tex = _image.renderer.material.mainTexture;
_image.renderer.material.mainTexture = imagetemp.texture;
n++;
Resources.UnloadAsset(tex);
yield return new WaitForSeconds(1f);
}
}
when display the third image, i receive an error : UnloadAsset can only be used on assets ? what can i do ?