Author Topic: Little issue with UIButtonScale Script.  (Read 3369 times)

boudboa

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Little issue with UIButtonScale Script.
« on: November 29, 2012, 10:34:08 AM »
I actually had 2 of those attached to a button,
one acting on the button itself and another one acting on another button.

I ended up to have some strange case where the scale of one button ended up to be zero.
It was happening when the he button was disabled using an anim (much like in example 3 with menu transitions)

After a few debug log i believe I found the issue, In UIButtonScale Script line 31 I added the text in blue:

      if (tweenTarget != null && mInitDone)

As this bug was not always happening I seems to have fixed the issue but i can't tell for sure still...



ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Little issue with UIButtonScale Script.
« Reply #1 on: November 29, 2012, 10:35:30 AM »
You should lever scale to/from zero. Size of zero makes it impossible to determine the inverse of the transform due to a division by zero.

boudboa

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: Little issue with UIButtonScale Script.
« Reply #2 on: November 29, 2012, 12:02:55 PM »
I was actually not setting anything to zero but ended up with my buttons transform scale set to zero.
Tracking it down, it showed to happen in the OnDisable function of the UIButtonScale Script when mInitDone was false.

I just added this little test and it seem to work fine now.