Upgrading from 2012
« on: May 26, 2015, 08:58:12 PM »
Hi all. A bit of background on my issue: my team is on a version of HOTween from 2012, and due to a pretty serious bug we've encountered, I've decided that maybe upgrading to DOTween will help eliminate the problem.

Is there a guide / tips for upgrading from Ye Olde HOTween to DOTween? Thanks!

Edit: found this: http://blog.demigiant.com/?p=375

Still trying to work through it, since it doesn't quite address my problem with TweenEvent being gone.
« Last Edit: May 26, 2015, 11:00:21 PM by Darcy »

*

Daniele

  • Dr. Admin, I presume
  • *****
  • 378
    • View Profile
    • Demigiant
Re: Upgrading from 2012
« Reply #1 on: May 27, 2015, 02:51:16 AM »
Hi,

I was just going to mention that blog post, but I see you found it already. TweenEvent can be easily be replaced with an anonymous function. For example, if you want to pass the tween to an OnUpdate callback, you can do:
Code: [Select]
myTween.OnUpdate(()=>MyFunction(myTween));
By the way, what issue did you find in HOTween? I definitely recommend DOTween over that, since it's much more efficient and flexible, but you could also try to update to a more recent version of HOTween, in case that bug, whatever it was, was solved?

Cheers,
Daniele

Re: Upgrading from 2012
« Reply #2 on: May 27, 2015, 04:04:27 AM »
Thanks for the quick reply!

My issue is that it seems like some of our tweens get interrupted and never complete if another tween is activated while the first is still resolving. I'm having a hard time debugging the problem; a long-gone engineer installed HOTween and I hardly know a thing about it.

Anyway, I figured it might be a good time to upgrade to DOTween in case the bug wasn't caused by something we are doing. Unfortunately, TweenEvent no longer exists (we used it heavily in our code) and doesn't exist in the documentation as deprecated. So it looks like in order to get DOTween working, it's going to take a bit more than a search-and-replace to get this integrated.

*

Daniele

  • Dr. Admin, I presume
  • *****
  • 378
    • View Profile
    • Demigiant
Re: Upgrading from 2012
« Reply #3 on: May 27, 2015, 01:34:29 PM »
Yup, the logic is very similar, but the API is different (and much easier to use, if I may say so), so it's not just a search and replace. It should be easy if you were accustomed to HOTween, but if not it will take some work.

By the way, about your HOTween issue, consider that HOTween had an overwrite manager, so if a tween was started while another identical one (meaning same target and property) was running, the older one was canceled. DOTween, due to its lighter nature and architecture, doesn't have an overwrite manager, but you still can't run two tweens on the same property of the same target at the same time (unless you use Blendable tweens).

Re: Upgrading from 2012
« Reply #4 on: May 28, 2015, 12:12:42 AM »
 I think the issue was a combination of running tweens with the same target/attrs like you said, and our OnComplete callbacks. In any case, I cleaned up some code, got DOTween running in parallel with HOTween, and now the bug is fixed.

Thanks for the awesome support! I'll definitely be back to bother you with silly newb questions.

*

Daniele

  • Dr. Admin, I presume
  • *****
  • 378
    • View Profile
    • Demigiant
Re: Upgrading from 2012
« Reply #5 on: May 28, 2015, 01:43:32 PM »
Great! I'll be here and ready to answer ;)