Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Landci on February 02, 2015, 10:42:13 AM

Title: Calling Button OnClick method by script
Post by: Landci on February 02, 2015, 10:42:13 AM
Hello
i am trying to call the onClick Method from a Button by script and i want to execute the notify elements within the onClick Method.


What i am doing is:

buttonGameObject.SendMessage("OnClick");

so, i can hear the sound of the button being executed but all the notify references i set in the
OnClick Method are not being called, what am i doing wrong?
Title: Re: Calling Button OnClick method by script
Post by: ArenMook on February 03, 2015, 10:36:50 AM
EventDelegate.Execute(button.onClick);

P.S. You may want to look at UIKeyBinding...