Hello,
I am using these 2 GUI buttons as info buttons.When “INFO 1” is clicked, a window with text opens with the “Close” option.But the problem is that the other GUI buttons are also active while the Info window is still opened, which is not good.What I want to do is, when I click on “INFO 1” button and the info window opens, no other button should be active until this window closes, or even better, if I have clicked to open the info window 1 and I click on the “INFO 2” button, then the text would be replaced with the text of the info window 2 and vice versa.
I think it is a “if” and “and” condition to do with this but I just don’t know how to do this. Any information or suggestion would be very helpful and greatly appreciated!!!
Thank you in advance
var showMoreGui1 = false; var showMoreGui2 = false; function OnGUI () { if (GUI.Button (Rect (10,Screen.height -510, 40, 40), "INFO 1")) showMoreGui1 = true; if (GUI.Button (Rect (10,Screen.height -450, 40, 40), "INFO 2")) showMoreGui2 = true; if (showMoreGui1) { GUI.Box (Rect (60,Screen.height -510,450,350), "Hello there"); if (GUI.Button (Rect (60,Screen.height -510,100,20), "Close")) showMoreGui1 = false; } if (showMoreGui2) { GUI.Box (Rect (10, 40,100,20), "Hello there"); if (GUI.Button (Rect (10, 70,100,20), "Close")) showMoreGui2 = false; } }