Problem with Application.Quit
Hi guys. Now I have a problem. When I use command Application.Quit() it does not work. Look at this snippet:
if (GUILayout.Button ("Quit"))
{
audio.PlayOneShot(beep);
Application.Quit();
}
Button appears, sound plays, but my game continues. Help me, please!
So I have the same problem my applicaton.quit won't work but.. I am launching my game in my samsung galaxy.
if(GUI.Button(new Rect((int)menu$$anonymous$$ainX,340,240,60), "Exit")) {
Application.Quit();
}
Button works (tested with debug log) but doesn't quit the application, when i press it it kinda freeze so no hover texture and release texture but rest of the menu and app itself works correctly. Surprisingly it works when I set it up to exit on back key in my cell
if(Input.Get$$anonymous$$ey($$anonymous$$eyCode.Escape))
{
Application.Quit();
}
any ideas?
Sorry for asking in another question but apparently I don't have rep to make a separate thread and I googled for the solution for around 30 $$anonymous$$utes..
Answer by Visual Programmer · Sep 28, 2013 at 03:57 PM
Build and run your game. Quit() does not work in PIE.
Answer by Ericroy · Sep 28, 2013 at 04:06 PM
It won't stop if you are running it in the Unity window. It should work if you build it and then run the built version.
Remember to mark answers as correct if they solve your problem!