Hello,
I have a blank gameobject that contains 70 some odd prefabs (generated at run-time). I want to be able to loop through the prefabs and add a WWW object which will be setting its texture as soon as the download completes, but I need to track which prefabs have have WWW objects that aren’t isDone, so that I could dispose of the WWW object that is associated with that particular prefab. Here is an example of what I have/need (simplified):
for(var child : Transform in transform){
var txt = new Texture2D(tileSize, tileSize, TextureFormat.DXT1, false);
var www = new WWW("urlgoeshere");
yield www;
www.LoadImageIntoTexture(txt);
child.guiTexture.texture = txt;
child.newpropertynamehere = www; // THIS IS WHAT I NEED
}
So that later I can do:
for(var child : Transform in transform){
if(!child.newpropertynamehere.isDone) child.newpropertynamehere.Dispose();
}
Any help would be greatly appreciated!
Jake