Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: neufoctobre on January 04, 2018, 01:17:30 PM
-
Hi there,
Not sure this is a NGui problem but I become mad about a problem about sendMessage.
I have one script calling a sendMessage("OnClick") to UIButton. The gameObject where the UIButton is attached have some Methods and UIPlayAnimation attached on him.
The method of UIButton are not called but the UIPlayAnimation attached to the gameObject are called. I have other button and a previous project with exact same code and working well, but One of my buttons method are not called. I found a solution by adding this line :
EventDelegate.Execute (Button.onClick);
This is driving me crazy, can't found why it's not working even any idea ....
Thanks !
-
Ok I found that when I use sendMessage, the UIButton script "onClick" function is not called because UIButton.Current is not null.
Then before sending message I set UIButton.Current = null and its working.
is this normal ??