Hey guys, having some difficulties here. I’m trying to make a level list on my game. I have it working pretty well but I can’t get a button to appear after each listing (to play the level). Here’s what my script looks like…
PHP:
for($i = 0; $i < $num_results; $i++)
{
$row = mysql_fetch_array($result);
echo ("Level name: " . $row['lvlname'] .
"
Level Description: " . $row[‘description’] .
"
Level Rating: " . $row[‘rating’] .
"
if(GUILayout.Button("Play!")) {
//Play Level
}
");
}
And in game, I have this script:
var lvl_get = WWW("http://www.coreymccown.com/Unity/BallGame/levellist.php");
yield lvl_get;
if(lvl_get.error) {
print("There was an error getting the level list: " + lvl_get.error);
} else {
LevelsText = lvl_get.text; // this is a GUIText that will display the level list
}
And my result is:
(Pardon my mild swearing, just entertaining my boring self.)
I dunno what to do! Any help is greatly appreciated! Thanks!