Author Topic: 3.0.9f1 broke my tweens!  (Read 4636 times)

makeshiftwings

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 25
    • View Profile
3.0.9f1 broke my tweens!
« on: January 18, 2014, 04:29:45 PM »
(Edit: solved, see second post)

I had a Table full of icons in a Panel that would tween position down, then reorder the icons, then reset the tween and play it again.  (Basically to create a looping slot machine sort of effect).  This was working fine until the update to 3.0.9f1 today.  Now it tweens down only once, and when I call tween.ResetPosition and tween.PlayForward from OnTweenFinished, it doesn't seem to do anything.  I saw in the patch notes that you made some changes to how OnTweenFinished works, but in my case it seems to have broken all the tweens.  Any ideas?
« Last Edit: January 18, 2014, 05:28:56 PM by makeshiftwings »

makeshiftwings

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 25
    • View Profile
Re: 3.0.9f1 broke my tweens!
« Reply #1 on: January 18, 2014, 04:54:00 PM »
The change that broke it is this, from the Update call in UITweener:

  1. List<EventDelegate> mTemp = onFinished;
  2. onFinished = new List<EventDelegate>();
  3. EventDelegate.Execute(mTemp);
  4.  

You set onFinished to an empty list, which makes it delete the onFinished method after the first tween, so it never gets called again.  Looking at it, I assume you meant to add "onFinished = mTemp" afterwards.  I added that and it fixed it.
« Last Edit: January 18, 2014, 05:27:45 PM by makeshiftwings »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: 3.0.9f1 broke my tweens!
« Reply #2 on: January 18, 2014, 10:01:49 PM »
That's a good point, but the correct fix is to re-add the mTemp delegates to onFinished, not overwrite them:
  1.                         // Re-add the previous persistent delegates
  2.                         for (int i = 0; i < mTemp.Count; ++i)
  3.                                 EventDelegate.Add(onFinished, mTemp[i]);

vallcrist

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 49
    • View Profile
Re: 3.0.9f1 broke my tweens!
« Reply #3 on: January 19, 2014, 11:17:25 PM »
So.. is this a bug or intented behaviour?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: 3.0.9f1 broke my tweens!
« Reply #4 on: January 19, 2014, 11:18:35 PM »
Bug that will be fixed in 3.0.9 f2 in a few hours.

DevFromSpace

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 10
    • View Profile
Re: 3.0.9f1 broke my tweens!
« Reply #5 on: January 20, 2014, 04:06:30 AM »
howdy ow, i had all my button animation behaving strangely, should i wait the update and do nothing else?

dominus85

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 31
    • View Profile
Re: 3.0.9f1 broke my tweens!
« Reply #6 on: January 20, 2014, 04:14:25 AM »
the 3.0.9f2 update is already on the asset store

DevFromSpace

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 10
    • View Profile
Re: 3.0.9f1 broke my tweens!
« Reply #7 on: January 20, 2014, 05:48:24 AM »
well i updated and my button tweens are style broken since the update, i disable button by code but since the update all the button are activated, and the hover state stay on when the cursor is not over, is it possible to have this problem fixed?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: 3.0.9f1 broke my tweens!
« Reply #8 on: January 20, 2014, 06:41:42 AM »
I'm guessing you have UIButton script attached to the same object as UISprite set to auto-resize its collider? Change UIWidget.UpdateVisibility function to this:
  1.         public bool UpdateVisibility (bool visible)
  2.         {
  3.                 if (mIsVisible != visible)
  4.                 {
  5.                         mChanged = true;
  6.                         mIsVisible = visible;
  7.                         if (autoResizeBoxCollider && collider != null && GetComponent<UIButton>() == null)
  8.                                 collider.enabled = visible;
  9.                         return true;
  10.                 }
  11.                 return false;
  12.         }

DevFromSpace

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 10
    • View Profile
Re: 3.0.9f1 broke my tweens!
« Reply #9 on: January 20, 2014, 07:05:09 AM »
thank you fixed the last version ;D is it possible to include this into next update?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: 3.0.9f1 broke my tweens!
« Reply #10 on: January 20, 2014, 07:07:43 AM »
Yeah, I'll include it. It's a bit of a hack though...