GUI.depth issue

I have a lot of buttons in my GUI, and some are on a dropdown menu (custom button layout that return from something from a list). My issue is when ever I have the dropdown menu over a none-button object (say a textarea or a toggle), the textarea or toggle with absorb the first click.

I tried putting GUI.depth = 1 and 0 and -1, and it won’t work. Do I need to put GUI.depth = 0 in all my other GUI calls?

Basically, all my GUI calls are going through a seperate class (so I call newgui.newbutton for instance), and I want to put the GUI.depth call for my dropdown menu in there. Possible?

Found my solution, due to unity’s relatively idiotic way of handling objects in the reverse order it draws it (button1, button2, button3 will be drawns button1->button2->button3 but the clicks will go button3->button2->button1), I just put my dropdown menu to be drawn at the top of the GUI call and the bottom - this means it catches all clicks before any other GUI code does and draws it on top as well.

Easy fix, all things considered.

While I’ve never done this, looking at the documentation of GUI.depth, the example unityscript code shows that they specifically set both GUI elements depth. You may(read as probably) need to set the depth of the offending GUI elements to adjust the layering correctly.