i made a game that gets images from a directory on a website by getting a list off a php page. the problem is that when i try to load the game (usualy it works but usualy im not trying to load 59 images at once) it always becomes unnresponsive and i cant do anything. is there a better way to load the images
(the script to load the images is)
var imageobj : Transform;
var string = "";
var location = 0.0;
var oldwidth = 0.0;
function Start () {
var www1 : WWW = new WWW ("unitygameimagelist.php");
yield www1;
var list = www1.data;
var string = list.Split("\n"[0]);
var x = 0; for(x in string) {
// Start a download of the given URL
var www : WWW = new WWW (x);
yield www;
if (oldwidth != 0.0) {
location = location-(oldwidth/2.0)-2.0-(([url]www.texture.width/100.0[/url])/2.0);
}
var image = Instantiate(imageobj, new Vector3(location, 0.0, 0.0), Quaternion.identity);
oldwidth = [url]www.texture.width/100.0;[/url]
image.rotation = new Quaternion.AngleAxis(90, Vector3.right);
image.renderer.material.mainTexture = [url]www.texture;[/url]
image.transform.localScale.x = [url]www.texture.width/100.0;[/url]
image.transform.localScale.z = [url]www.texture.height/100.0;[/url]
}
}
(of course it could be im testing it on a school network that not only runs through a proxy but also is used by eveyone at the school for internet)(unfortunetly i cant give a link to the game)