I was wondering if there is a way to put a GUI.Box in front of a window that isn’t part of that window. Is this even possible in Unity?
What u trying to create?
I don’t know if there is a set way to do it, but i have used a kind of trick to do this.
What i did was to create a new window and make that window’s backGround color clear, then use the bring to front method.
You can make the window clear but not it’s contents.
You can do it,by writing two different scripts for each GUI element you want to make it ordered,
and define the GUI.depth in the OnGUI Method.
it goes from 0-1, when 0 is the upper,and 1 is the lower layer.
void OnGUI () {
GUI.depth = 0;
GUI.Box(new Rect(50,50,500,500),"cONTENT");
}
thats an example,and you also need to defined lower layer on the window of course. ![]()
This doesn’t work with GUI windows. Black Mantis has the correct solution.