Hi, guys:
I’m having a problem with buttons inside a GUI Window. I want a message appears when the player clicks a button to remind him he has chosen that option, but i dont want to use option buttons, just normal ones. So i got this code:
/*EDIT:*/ string txt_menu1="";
void OnGUI (){
GUI.Window(1, new Rect(20, 20, 180, 300), menu1, "Menu One");
}
void menu1(int windowID) {
if (GUI.Button(new Rect(10, 20, 160, 50), "Choose option 1")) {
UseType1=true;
txt_menu1="You have chosen Option 1";
}
GUI.Label(new Rect(10,200,160,90), txt_menu1, "Box");
}
This is not working. When i press the button nothing happens. I’m guessing the function menu1 is only called on creation though i’ve seen in the documentation some examples where the code is written there, in the Window creation function, same for the text to be shown (txt_menu1). What am i doing wrong?