I'm transferring from Unity's UI to NGUI.
Formerly, I could add listeners to button with following scripts:
button.GetComponentInChildren<Button>().onClick.AddListener(() =>
{
//codes that could be triggered by click the button.
});
But when changing to NGUI, I can't make it work by:
EventDelegate.Set(go.GetComponent<UIButton>().onClick, OnButtonClickActive);
private void OnButtonClickActive()
{
Debug.Log("active button clicked");
}