var isWrong = false;
function Update()
{
.
.
.
else if(selected_00.GetComponent(textOnMouse00).thisRadical.ID != selected_0.GetComponent(textOnMouse0).thisRadical.ID)
{
isWrong = true;
//score -= 500;
}
}
}
function OnGUI()
{
if(isWrong)
{
GUI.Window(0, Rect((Screen.width/2)-90, (Screen.height/2)-190, 300, 150), showGUI, "I'm Sorry!!");
}
}
function showGUI()
{
if(isWrong)
{
// You may put a label to show a message to the player
GUI.Label(Rect(65, 50, 200, 80), "Boo..Boo.. WRONG WORDS!!!");
}
// You may put a button to close the pop up too
if (GUI.Button(Rect(60, 90, 75, 30), "OK"))
{
isWrong = false;
}
}
I would like to ask what wrong with my code. It can’t seem to close the window if i click ok.