Author Topic: Method not listed on Click method attribute of UIButton  (Read 5381 times)

rextr

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 15
    • View Profile
Method not listed on Click method attribute of UIButton
« on: March 09, 2014, 07:48:43 AM »
Hi,

I have just found an interesting bug in 3.4.9. When a method has "yield WaitForSeconds("1.0f")" in it, then that method is not listed in the dropdown of UIButton's Click method attribute.

rextr

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 15
    • View Profile
Re: Method not listed on Click method attribute of UIButton
« Reply #1 on: March 09, 2014, 08:16:25 AM »
Another bug in 3.5.x is that when I click a button that calls a method in which I have a third-party method call (like Everyplay and Chartboost), it crashes when I touch that button on iPhone/iPad, which does not happen in 3.4.9. That's why I have switched back to it.
Note: I'm using Unity 4.2.2f1, javascript.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Method not listed on Click method attribute of UIButton
« Reply #2 on: March 09, 2014, 09:54:52 AM »
The button works with plain functions, and won't work with coroutines. Coroutines is a Unity thing, and must be created using StartCoroutine. You can only yield in coroutines.

The button's click functionality hasn't changed in months, and is identical in 3.4.9 and 3.5.x. Nothing NGUI does can result in a crash. Crashing can only happen inside your third-party plugins.

rextr

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 15
    • View Profile
Re: Method not listed on Click method attribute of UIButton
« Reply #3 on: March 09, 2014, 12:39:45 PM »
Did I mention that the exact same code works in Ngui 3.4.9? After upgrading to Unity 3.5.1, I have received the EXC_BAD_ACCESS as shown in the attached image. It can't even reach the third party code. My guess is that it's related with I'm using javascript instead of C# and you are working and testing on C#. Maybe that's why you didn't notice it.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Method not listed on Click method attribute of UIButton
« Reply #4 on: March 10, 2014, 08:54:23 PM »
I'm not sure what would cause that to occur, javascript or not. Bad access is an error deep in Unity. If you can figure out a way to reproduce it using stock NGUI, I'd love to have a look.