Hey! This is kind of a beginner’s question, but I can’t seem to make this work and I’m getting kind of frustrated.
I have a tools box which contains two buttons, and I’d like that each time the player clicks one of those buttons, a GUI.Box will be drawn in the screen with some info.
This is the code I have:
// C#
private void OnGUI() {
...
if (GUI.Button(addGroupRect, "+Group")) {
Debug.Log("+Group");
GUI.Box(new Rect(20, topPanHeight + 20, 100, 30), "Box1");
}
if (GUI.Button(addElemRect, "+Elem")) {
Debug.Log("+Elem");
GUI.Button(new Rect(40, topPanHeight + 20, 100, 30), "Elem");
}
Any ideas on why nothing new is drawn when the buttons are clicked?
Thanks in advance,
Valter