Demigiant Forum

Unity Assets => DOTween & DOTween Pro => Topic started by: JosYule on July 07, 2015, 06:20:38 PM

Title: DOPlayBackwards method does not fire OnComplete
Post by: JosYule 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
Title: Re: DOPlayBackwards method does not fire OnComplete
Post by: Daniele 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 (http://dotween.demigiant.com/documentation.php?api=OnRewind) to check when it's rewinded :)
Title: Re: DOPlayBackwards method does not fire OnComplete
Post by: JosYule 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
Title: Re: DOPlayBackwards method does not fire OnComplete
Post by: Daniele on July 07, 2015, 07:01:33 PM
You're welcome :)