0
我正在从Unity的用户界面转移到NGUI。以统一方式处理ngui的按钮事件
以前,我可以添加监听器按钮,以下脚本:
button.GetComponentInChildren<Button>().onClick.AddListener(() =>
{
//codes that could be triggered by click the button.
});
但改为NGUI的时候,我不能让它的工作:
EventDelegate.Set(go.GetComponent<UIButton>().onClick, OnButtonClickActive);
private void OnButtonClickActive()
{
Debug.Log("active button clicked");
}
什么是编译时错误? – kennyzx
@kennyzx没有错误显示。只是不工作。 – armnotstrong