Script not integrating properly with OnClick button event

I have two scripts. This one:

using UnityEngine;
using System.Collections;

public class QuitOnClick : MonoBehaviour {

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

}

when I add it to a button I can add an element in the On Click () whateveritiscalled and tell it to “QuitOnClick.Quit”.
But this script:

using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;

public class LoadScene : MonoBehaviour {

    public int sceneIndex = 1;

    public void Load()
    {
        SceneManager.LoadScene(sceneIndex);
    }
}

Doesn’t give me the same option, despite being almost exactly the same.

Turns out it matters how and where from you drag your script to the “On Click ()” thingy.

If you do it from the project tab you get my problem, if you add the script as a new component to the button and drag that component to the “On Click ()” it works fine.