Hi all, it seems like I cannot get the buttons to even display.
I don’t understand why… maybe because we cannot create GUI buttons inside of a foreach loop? I don’t see why this could be impossible…
foreach(string jjj in maps)
{
Debug.Log ("------------------- OK: " + jjj);
//I correctly see all the jjj strings in the console, one per line. The problem is below.
if(GUI.Button(new Rect(10,60 + yOffset,50,25), jjj))
{
loadlevelname = jjj;
Debug.Log ------------------LOADLEVELNAME: " + loadlevelname);
}
yOffset += 35;
}
I know this is old but for anyone still looking for a similar answer, it’s because of this:
foreach (PhotonPlayer player in PhotonNetwork.playerList) {
GUI.Label(new Rect(400, 15+ yOffset, 200, 25), player.name);
yOffset += 30F;
}
This is my code at the moment, if you put this inside a keypress you’ll notice that yOffset +=30F is scrolling ALL items, not adding to the height so they are under each other. I haven’t yet figured out a way to do this properly.
I know this is old but for anyone still looking for a similar answer, it’s because of this:
foreach (PhotonPlayer player in PhotonNetwork.playerList) {
GUI.Label(new Rect(400, 15+ yOffset, 200, 25), player.name);
yOffset += 30F;
}
This is my code at the moment, if you put this inside a keypress you’ll notice that yOffset +=30F is scrolling ALL items, not adding to the height so they are under each other. I haven’t yet figured out a way to do this properly.