Author Topic: Tween delay bug, fix inside  (Read 3675 times)

Eskema

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 12
    • View Profile
Tween delay bug, fix inside
« on: April 05, 2013, 10:29:31 AM »
Hi,

I've found a bug regarding the delay function of the tweens. Right now if you create a tween and set the delay value it works perfectly, BUT if you want to reset the tween to use it again the delay won't be called anymore.


Just a matter of modifying the UITweener.cs line 300 with this
  1. public void Reset() { mStarted = false; mFactor = (mAmountPerDelta < 0f) ? 1f : 0f; Sample(mFactor, false); }

And set the started to false to calculate the delay

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Tween delay bug, fix inside
« Reply #1 on: April 05, 2013, 11:43:12 AM »
Thanks, I will add it in and see if I notice anything wrong.

Eskema

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 12
    • View Profile
Re: Tween delay bug, fix inside
« Reply #2 on: April 05, 2013, 12:02:57 PM »
In theory nothing wrong should happen, the only thing this does is to reset the calculation on the update method to take into consideration the delay, otherwise the delay will be used only the first time you use the tween.

If you just create and destroy tween on runtime there's no need for a fix, but if you use the same tween over and over like I do, then the reset() method won't restore or take into consideration the delay if you change it :)