I have a toolbar. When I click the first button, I was expecting the GUI to create a new button but it didn’t. why?
CODE:
private Rect fsad = new Rect (120, 120, 500,500);
void OnGUI () {
if (skin != null) {
GUI.skin = skin;
}
GUI.Box(new Rect(0,0,Screen.width,Screen.height),"Pause menu");
toolbarInt = GUI.Toolbar (new Rect(0,50, Screen.width,50),toolbarInt, toolbarStrings);
if (GUI.changed)
{
Debug.Log("The toolbar was clicked");
if (0 == toolbarInt)
{
GUI.Button (fsad, "Button");
}
if(1 == toolbarInt){
Debug.Log("Second button was clicked");
}
if(2 == toolbarInt){
}
if(3 == toolbarInt){
}
}
}