How to get my Exit Game button to work properly?

I’m new to Unity, and I’m trying to get my Exit game button for my main menu to work properly, but I’m having some issues, here is my script:

using UnityEngine;
using System.Collections;

public class ExitGame : MonoBehaviour
{

    public void GameExit(string GameQuit)
    {
        Application.Quit();	
	}
}

Then I added an On Click () to my button, set it to Runtime Only, MonoScript.name and I assigned that script, and in the little dialogue box I put “GameQuit”.
The button does absolutely nothing.
Am I doing this completely wrong? How do I make it so that the button is responsive and quits the game?

If you’ve added your script to some gameobject and script is active then it should run and work, you can verify it simply just like that:

 public void GameExit(string GameQuit)
 {
     Debug.Log("Works!");//Works! should appear in console log each time you click your button
     Application.Quit();    
 }

Also note that you don’t really need argument for what you’re trying to do, so you can safely remove “string GameQuit”, unless you need it for something else of course.

But most likely you’re just confused as to why Application don’t quit while you’re running it in editor instead of running the actual build, if so then now you know. If you want to stop playing in editor on your “exit” button then you can do something like that:

public void GameExit()
{
    #if UNITY_EDITOR
    UnityEditor.EditorApplication.isPlaying = false;
    #else
    Application.Quit(); 
    #endif
}

Check if some other gui object doesn’t cover your exit button.