How to close the game using new UI

In my GUI screen I have Exit button. And I have a script:

void Start()
{
    Application.Quit ();
}

But I can’t understand, how to use this script in the new UI in the Button element.
What kind of function should I choose in the On Click component?

When I choose my script (Exit.cs), it doesn’t work.

Instead of “Start” (which will run as soon as the object is instantiated) name your function something else, “ExitButton” or something. When you choose the script, it will ask you what function to use. Pick that one.

Also, remember that you can’t quit while inside the Unity Editor, so you may want to print() or debug.log() to see that it runs when you click it.