DOPlayBackwards method does not fire OnComplete
« on: July 07, 2015, 06:20:38 PM »
I'm using a DOTweenAnimation component, set to do a fade.

I'm triggering it via a script, so to hide the component i'm calling DOPlayForward and to show it i'm calling DOPlayBackward.

I need to know when the animation is complete, so i'm using the "On Complete" event hook in the component to call a function in another script.

This works for the DOPlayForward style, but not for the DoPlayBackward call. How can i get a callback for when the animation is done when playing backwards? Ideally, i'd want the OnComplete called for this too.

Thanks
Jos

*

Daniele

  • Dr. Admin, I presume
  • *****
  • 378
    • View Profile
    • Demigiant
Re: DOPlayBackwards method does not fire OnComplete
« Reply #1 on: July 07, 2015, 06:28:47 PM »
Hi,


OnComplete is called only when the tween is complete, meaning it ends its forward play. When playing it backwards, you can use OnRewind to check when it's rewinded :)

Re: DOPlayBackwards method does not fire OnComplete
« Reply #2 on: July 07, 2015, 06:32:34 PM »
Ok, got it.

I've also started using the static methods on the DOTween class. I can add multiple DOTweenAnimation components to my GO, give them each an ID, and play them via the DOTween.Play(target,ID) method.

Thanks again,
Jos

*

Daniele

  • Dr. Admin, I presume
  • *****
  • 378
    • View Profile
    • Demigiant
Re: DOPlayBackwards method does not fire OnComplete
« Reply #3 on: July 07, 2015, 07:01:33 PM »
You're welcome :)