I have an editor window that draws a dynamic tree hierarchy, where each node is a GUI.Box, after that in the code I draw the connecting accordion lines. As you can see the lines are drawn in front of the tiles.
This is happening in a single script.
I moved the drawing of the tiles after the drawing of the lines, but it didnt work.
I tried GUI.depth, didnt work.
Edit:
What Im doing in code is:
foreach(allTiles) {
if(something) {
drawConnectinglines()
}
drawTileAndItsContent
}
Now Itried seperating the tile draw and line draw in different loops:
foreach(allTiles) {
if(something) {
drawConnectinglines()
}
}
foreach(allTiles) {
drawTileAndItsContent
}
The result is that now the lines are behind the buttons in the tiles, but infront of them: