Optimizing OnGUI - Too many gui elements?

Is there such a thing as too many gui elements? I find that when I deactivate the gui completely, my app runs a LOT faster. Is there a maximum number of recommended gui elements?

The OnGUI is quite slow. It gets called twice a frame and it will slow down your game. How much it will slow you down is dependent on the computer, the type of computational work your game will force mostly, and the GUI elements/styles you use. Usually on a computer its not too big a deal. If you find it is a big deal, then you should use cheaper alternatives such as GUITexture (which can still become expensive if you use it terribly).

One way to get around this is to have a GUI Manger script which has the arguements from each normal onGUI passed to it, so that you manager is the only thing running the actual onGUI function, while still displaying what any of the other onGUI functions normally would.

So you would do something like
if(clicked){
GuiManager.state = tree;
GuiManager.treeHeight = this.height;
}
on your trees whose height pops up in the GUI when clicked
and
onGUI{
if(state == tree){
if(GUI.Button(rect(x,y,x,y), treeHeight+"
close?")
}
}
on your GUIManager, with a slot for all of your previous different onGUIs in it. That way only one script is running onGUI multiple times a frame, but you still get the experience of everything creating a GUI texture when clicked.

(I apologize if my poorly written example code is confusing, but I hope the concept is still clear)