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”))

Button appears, sound plays, but my game continues. Help me, please!

Build and run your game. Quit() does not work in PIE.

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.