Sorry, I’m just new to scripting and I don’t know how this works…
I created a button and the code is written below:
if (GUI.Button(Rect(520,340,150,40), "Quit Game") == true)
{...}
Sorry, I’m just new to scripting and I don’t know how this works…
I created a button and the code is written below:
if (GUI.Button(Rect(520,340,150,40), "Quit Game") == true)
{...}
Something like this:
private var showPopup = false;
private var popupButton = false;
function OnGUI() {
if (GUI.Button(Rect(520,340,150,40), "Quit Game") {
showPopup = true;
}
if (showPopup) {
popupButton = GUI.Button(Rect(670,340,200,40), "Are you sure you want to quit?");
}
if (popupButton) {
//Do quit operation(s)
showPopup = false;
}
}