单击时的Unity5按钮不起作用

Unity5 Button on Click don't work

If you click here you can see there is no function there Unity Buildt 在一个组件中,您可以在其中选择脚本并从中选择任何函数。我写了这个脚本,当我想选择它写的函数时 "no function"。请帮助我!

 #pragma strict

    function QuitGamne() {
        Debug.Log ("Game is exiting....");
        Application.Quit ();
    }

    function StartGame() {
        Application.LoadLevel ("level1");
    }

因为你的函数是私有的。让他们 public.

#pragma strict
public function QuitGamne() {
    Debug.Log ("Game is exiting....");
    Application.Quit ();
}

public function StartGame() {
    Application.LoadLevel ("level1");
}