

(You may want to check and re-register the rectangle with the manager on every OnGUI call, for safety's sake - the advantage of using our C# Dictionary here is that it prevents us accidentally registering a window twice.) Hence the UI manager always knows which areas of the screen are covered by GUI windows.

If we hide the GUI, we de-register the GUI window rectangle.

The easiest way to do this, I think, is to use a C# Dictionary object. We create a UI Manager object which contains a table of Window ID (int) to Window Rectangle (Rect) mappings.Also, it's a bit complicated but it should work. The main drawback of my solution is that it requires you to put everything in a GUI.Window - thus you can't use odd-shaped "floating" buttons with it, unless you place the buttons on top of an invisible window. This is kind of late, but I was working on the same problem and I think I've come up with a solution which addresses the problems above.
