You see, I created a script in Unity to exit the game, but I had to add it to the OnClick event and when I looked for it I couldn't find it, does anyone know if something should be activated or add a script? If it is to add a script, could you leave it to me here? I leave you an image just in case, I hope I have been clear, thanks :/
PS: I am using Unity 2018.2.13f1 in 2D mode
I think you mean add it to a button....create a button (inside the canvas), inside the button object will be the OnClick event, that's where you should add it.
DSRaptor, in addition to cmanzo's answer there is something missing:
To add functions to your buttons, you must drag an object that contains the script. Therefore, you will have to drag to
onClick()
your button an object that has your script with the function that you want to use.