- Home /
              This question was 
             closed Aug 30, 2015 at 06:14 PM by 
             getyour411 for the following reason: 
             
 
            The question is answered, right answer was accepted
 
               Question by 
               conflictbliz · Aug 10, 2011 at 08:41 PM · 
                mouseclickexit  
              
 
              How Do You Exit A Game
i dont know the name of the code so that i can exit the game when i press the button yes here is my code:
 function OnGUI () {
 // Make a background box
GUI.Box (Rect (10,10,300,90), "Exit To Desktop?");
 // Make the first button. If it is pressed, Application.Loadlevel (1) will be executed
 if (GUI.Button (Rect (130,40,80,20), "Yeah")) {
 }
 }
               Comment
              
 
               
               
               Best Answer 
              
 
              Answer by Meltdown · Aug 10, 2011 at 09:06 PM
 if (GUI.Button (Rect (130,40,80,20), "Yeah")) {
     Application.Quit();
 }
Thanks For Help just edited it a bit and it worked :) thanks!
Follow this Question
Related Questions
Only updating once during left mouse button being held down. 3 Answers
How to make object clickable when user enter collider ? 0 Answers
How do you check if the object that you want to destroy with a click is the right object? 1 Answer
My inventory opens and closes on left mouse click when i don't want it to. 1 Answer
pause game 2 Answers
 koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                