📅  最后修改于: 2022-03-11 14:48:56.185000             🧑  作者: Mango
GameObject buttonPrefab;
void MyAwesomeCreator()
{
GameObject go = Instantiate(buttonPrefab);
var button = GetComponent();
button.onClick.AddListener(() => FooOnClick());
}
void FooOnClick()
{
Debug.Log("Ta-Da!");
}