Hello, I am wondering how I can assign a variable to a GUI component. Let me explain it using this example: Code (CSharp): if (GUI.Button(new Rect(20, 40, 80, 20), "Start")) { Application.LoadLevel(1); } if (GUI.Button(new Rect(20, 70, 80, 20), "Settings")) { } if (GUI.Button(new Rect(20, 100, 80, 20), "Dev Team")) { } if (GUI.Button(new Rect(20, 130, 80, 20), "Quit")) { } if (Window1) { GUI.Box(new Rect(10, 200, 200, 200), "Settings"); } if (Window2) { GUI.Box(new Rect(10, 200, 200, 200), "Dev Team"); } } } I have already assigned public bool Window1, etc. In my idea it would be easy to just assign a variable to the GUI button that says settings and the GUI button that says Dev team. Once those variables are set I can make the GUI box called settings apear and disapear upon the button press, However I do not know how to declare a variable for a specific GUI. If you know any 'easier' ways of doing what I wanted to do please tell me. ,Thank you.
Whoa there, you shouldn't expect an answer in the first 20 minutes. A polite waiting time until you bump is 24-48 hours.
You can: - Use delegate type function, to paint different Windows. - Divide GUI script in GameObjects. And after, activate/desactivate GameObjects to show/hide Window.