I have this window with a set of buttons in it. These buttons get made by a loop pulling information from somewhere else. It works all fine until I go to try and click a button. When I hover of the button, it looks like it gets pushed, but it is not being pushed. Then pushing the button doesn’t work as well. Any ideas why?
function gameWindow(id : int){
var a : int = gameList.gameCount;
var yLoc : int = -35;
for(var x = 0; x < a; x++){
yLoc += 45;
var gameID : int = game.id[x];
var turnNumber : int = game.turn[x];
var button = GUI.Button(Rect(10, yLoc, 780, 35), "Game ID: " + gameID + " " + "Turns Completed: " + turnNumber);
if(button){
Debug.Log("It worked! " + gameID);
}
}
GUI.BringWindowToBack(0);
GUI.UnfocusWindow();
}
function OnGUI () {
GUI.Window (0, Rect(Screen.width/2 - 400, Screen.height/2 - 300, 800, 600), gameWindow, "");
}