hi im trying to make a logout screen ive made it so when you click on a little x it opens a label with some text and buttons, my yes button takes me back to the main menu i want to know how to make it exit my main label and all the buttons and text here is the code:
public bool exitbuttonclicked = false;
public float exitLabelTextLeft = 300;
public float exitLabelTextRight = 7;
public float exitLabelTextWidth = 100;
public float exitLabelTextHeight = 100;
public float noExitButtonLeft = 738;
public float noExitButtonRight = 50;
public float noExitButtonWidth = 20;
public float noExitButtonHeight = 20;
public float yesExitButtonLeft = 738;
public float yesExitButtonRight = 50;
public float yesExitButtonWidth = 20;
public float yesExitButtonHeight = 20;
public float closeButtonPosLeft = 50;
public float closeButtonPosRight = 50;
public float closeButtonHeight = 20f;
public float closeButtonWidth = 20f;
public float exitBarLabelLeft = 738;
public float exitBarLabelRight = 20;
public float exitBarLabelHeight = 200;
public float exitBarLabelWidth = 200;
//changes exitbutton clicked to be true
if(GUI.Button(new Rect(closeButtonPosLeft, closeButtonPosRight, closeButtonWidth, closeButtonHeight),"x", closeButtonStyle)) {
exitbuttonclicked = true;
}
//displays exitbuttonlogout screen
if (exitbuttonclicked)
{
//displays logout box
GUI.Label(new Rect(exitBarLabelLeft, exitBarLabelRight, exitBarLabelWidth, exitBarLabelHeight), logoutImage);
//displays the text
GUI.Label(new Rect(exitLabelTextLeft, exitLabelTextRight, exitLabelTextWidth, exitLabelTextHeight), "Are you sure you wish to exit?");
//the yes button
if(GUI.Button(new Rect(yesExitButtonLeft, yesExitButtonRight, yesExitButtonWidth,yesExitButtonHeight), "Yes")) {
Application.LoadLevel("Main Menu");
}
// the no button
if(GUI.Button(new Rect(noExitButtonLeft, noExitButtonRight, noExitButtonWidth, noExitButtonHeight), "No")) {
Debug.Log("No Clicked");
}
}
i would prefer c# please i'm not very good at JavaScript
thanks in advance