Author Topic: UITweener.ResetToBeginning() / UITweener.current issue  (Read 15344 times)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UITweener.ResetToBeginning() / UITweener.current issue
« Reply #15 on: May 25, 2014, 05:40:18 PM »
I don't understand... you want me to add an entire new function because you don't want to call "_tween.factor = 1f;" ?

gyd

  • Jr. Member
  • **
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 87
    • View Profile
Re: UITweener.ResetToBeginning() / UITweener.current issue
« Reply #16 on: May 25, 2014, 09:14:11 PM »
i am just think that users need some debug to find out they can't PlayReverse() at the first time,
and add _tween.factor = 1f, like me.

but they don't need to add _tween.factor = 0f, when they PlayForward() at the first time.

the ResetToBeginning() overloading suggesting may not a good solution for this issue ( in fact i said that just because i saw someone request the overload before, sorry )

let the problem simpler,
consider a user create a tween and disable it, he may want the tween be played for only once.

his script may just like this and makes sense:
  1. void SomeFunction()
  2. {
  3.     if( someCheck )
  4.         _tween.PlayForward();
  5.     else
  6.         _tween.PlayReverse();
  7. }
  8.  

but it should be in 3.5.8

  1. void SomeFunction()
  2. {
  3.     if( someCheck )
  4.         _tween.PlayForward();
  5.     else
  6.     {
  7.         _tween.factor = 1f;
  8.         _tween.PlayReverse();
  9.     }
  10. }
  11.  

again, sorry about my last reply, that didn't solve my question.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UITweener.ResetToBeginning() / UITweener.current issue
« Reply #17 on: May 26, 2014, 11:57:19 PM »
If the tween is already at A, there is no point in going from B to A using PlayReverse(), because there will be a visual "jump" where tween gets to the end then plays back to the start. If I was to change it to jump to the end, then the button hover animation would effectively break as well.

Think hovering over a button, then halfway through that hover animation, moving the mouse away. With the reset to factor of 1, there will now be an obvious jump to the final state before tweening back to the start. This is not ideal. What should happen is the current position of the tween should be used as the starting point, and only the direction should be reversed, making the transition seamless and invisible. So the end result would be going from A tween halfway to B, then back to A, rather than A tween halfway to B, jump to B, then tween to A.

Bottom line is if you want this jump, then you should request it by setting factor to 1. In most cases you won't want to, which is why it's the default behaviour.

gyd

  • Jr. Member
  • **
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 87
    • View Profile
Re: UITweener.ResetToBeginning() / UITweener.current issue
« Reply #18 on: May 27, 2014, 12:58:59 AM »
okay thanks.