- Home /
How to keep track of multiple GUI Windows?
How should I keep track of a multiple GUI window? I have a number of GUI.Window on screen, each was assigned an integer manually. The number of window is growing, and it is difficult to keep track which id number belong to which GUI.Window. How can I manage many GUI.Window easily? Should I use 1 - 10 for main screen, 11 - 20 for other scene, etc?
Answer by DaveA · Aug 13, 2013 at 06:15 AM
I've seen people use Object.GetInstanceID for that. You could also have a global function or variable that holds, say, the next integer. Like function MakeWindowID() which returns a static integer then increments it. Get it when the window opens and use until it closes. Each window will have its own unique ID.
Answer by ShadoX · Aug 13, 2013 at 05:54 AM
maybe keep a list of them or try assigning a name to each window?
$$anonymous$$eeping track window name is quite a headache. The one I am having struggling with is the ID number. Thanks.
Your answer
![](https://koobas.hobune.stream/wayback/20220613112104im_/https://answers.unity.com/themes/thub/images/avi.jpg)