- Home /
Loading multiple images using only 1 www call?
I am trying to create a multiplayer game with a menu in which I can see the games (wordfeud like) I am currently playing. That part I got, but i also want to view the user images of the players I am playing against.
As it is now I first call one WWW to get all the games with the url to the profile image. Then I afterwards call my server as many times as I have games, so if I 10 games I would call the server 10 times to get each image. That makes a lot of calls to my server and a lot of DL to my game. Is it possible to do this in 1 call./keep the connection open to the server for all 10 calls?
Here is how I do it now:
for(icount=0; icount < gamelist.Length; icount++){
allimages = gamelist[icount].Split("§"[0]);
yield imageswww;
imageswww = WWW(gamelist[3]); // the url to the image
yield imageswww;
if(imageswww.error != null){
} else {
profileimage[icount] = imageswww.texture;
}
}
Hoping 4 help and thanks in advance :-)
Hi, maybe is possible to run your code paralell in coroutine (always will be 10 calls if you will have 10 separate images) and store the images in www cache (so the next download will be very fast). Otherwise you have to implement your own server data access.