UItextureGO.material.mainTexture = www.texture;
ScrollViewGO.GetComponent<UIPanel>().Refresh();
I have a 1000 row each row have a UITexture downloaded from internet.
Of course I wont make a 1000 scroll item, instead, I only made 20, I will reposition them, reuse them, when user rolling the scroll view. so item 1 will beceom item 21...item 2 become 22, when scrolling down. It will fine.
But I find that, when I keep scrolling down the memory keep rising up..to 2.0GB and crashed unity....So I guess the uitexture replaced still inside the memory event a new
www.texture is assigned...
I tried Resourced.UnloadAsset..but it seems it cannot unload a texture, it can only unload a gameobject...Since the gameobject is to be reused and cannot be destoyed.....