- Home /
few questions about using www for getting bunch of images...
the thing i made works in editor and it is using www to get the images and show them as textures. here is the part that does that:
// Start a download of the given URL
var www = new WWW("file://"+imageListFullPath[currentImageIndex]);
// wait until the download is done
yield www;
// assign the downloaded image to the main texture of the object
tImages=www.texture;
this works good in the editor, ofcourse i am using http:// protocol when webplayer is uploaded to a server. but it does not work. it freezes. so to figure out what is going on i have to ask somebody more experienced to help me.
to get the list of all images in the folder i use this call from System.IO:
if(Directory.Exists(imageDir)){
//GET THE LIST OF IMAGES IN THE DIRECTORY var images : String[]=Directory.GetFiles(imageDir+shortName+"/");
} is this making a problem? can i get the list of files inside the folder through web player if the files are on the same server, i know that webplayer can not access local files from secuirty reasons?
When running from the editor, the folder that contains images is located here Application.dataPath+"/imageDir/", it seems that this is asset folder, so any change to this folder, like adding images to it, unity reimports assets. is this really needed, can i use some generic folder path that is outside of the asset folder?
When webplayer is built, where to put the image folder in relation to webplayer so i can read the files properly. This goes for local webplayer and uploaded to server?
Can anything be done with memory leak that is caused by downloading textures this way, memory does not go free when textures are not used any more?
I was frustrated the most of things worked properly in editor but when i tried to upload to server it crashed. basically it could be something really simple but i can not see it...
Thanks in advance for looking into this, it's appreciated!
You can't use System.IO
in a webplayer, period. Any web access has to go through WWW.