Author Topic: SendMessage not calling method but NGui Animations  (Read 6363 times)

neufoctobre

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 7
    • View Profile
SendMessage not calling method but NGui Animations
« 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 !

neufoctobre

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 7
    • View Profile
Re: SendMessage not calling method but NGui Animations
« Reply #1 on: November 22, 2018, 11:52:33 AM »
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 ??