【NGUI】Button动态添加带参数的方法


UIButton _btn;
void Awake(){
_btn.onClick.Add(new EventDelegate(() => { MyFunction(0); }));
}
void MyFunction(int index){
Debug.Log(""+index);
}

猜你喜欢

转载自blog.csdn.net/fcgdzh2008/article/details/80989635