It’s probably obvious to anyone using more than 3 or 4 GUI.Window’s that managing the ID’s is annoying. So rather than doing GUI.Window(11542,…) because you’ve forgotten which numbers have already been used, try this;
Create a static arraylist:
public static ArrayList GUIWindowList = new ArrayList();
In each window script, create a private int for the WindowID:
private int WindowID;
Allocate a unique ID for the window (pop this in Start() or Awake())
WindowID = YourGenericUIClass.GUIWindowList.Add("MyWindowName");
And when you call the Window, just use the WindowID int
GUI.Window(WindowID, WindowPosition, DoWindowFunction, YourGenericUIClass.GUIWindowList[WindowId].ToString());
The neat thing is that you can find and focus a window from anywhere else in your app by looking it up in the GUIWindowList (which is good if you want to write an automated help script etc).
Hope its useful to someone.