I have a question with the GUILayout.Window function. Option 1: GUILayout.Window(0, mDebugRect, MakeDebugWindow, "Debug Window"); Option 2: mDebugRect = GUILayout.Window(0, mDebugRect, MakeDebugWindow, "Debug Window"); Why with option 1 I get flickering if for example I click on the window? It seems that it is compulsory the next time you call the function to use the return value rect.
You're right -- many GUI elements are fed into themselves for updating. (The GUI is rendered 2x each frame) Check this out: http://unity3d.com/support/documentation/ScriptReference/GUI.Window.html
Yes, the example does exactly that, but in no place it specifies that it is compulsory to pass the Rect back. In fact, I assumed that the return Rect was used for the user to get the actual size the Window function has calculated and used, so that the user can take any action like repositioning based on this size.