I’m doing a WWW call to get an online high score table. It’s taken from the high score example that everyone seems to throw around. It works perfectly well in the editor, but when I build it on the iPhone it freezes when called. Can’t quite figure out why, maybe someone has a good insight into this? Thanks!
// Get the scores from the MySQL DB to display in a GUIText.
function getScores() {
scoreText = "Loading Scores";
hs_get = WWW(highscoreUrl);
var timeOut = Time.time + 10;
while (!hs_get.isDone) {
if (Time.time > timeOut) {
break;
}
}
if(hs_get.data) {
scoreText = hs_get.data; // this is a GUIText that will display the scores in game.
} else {
scoreText = "Could not download high scores";
}
}