Working out when tweens are no longer running
« on: April 16, 2016, 03:56:29 PM »
I have the following set up:

There is a Sequence called MoveTween.

When I need to move an item in my game I create a Sequence with the Tweens to move that object, and I Insert it into MoveTween at time 0.

Often there are several items in motion at the same time, quite often some of these movements start with delays.

There are times when it is necessary for me to ensure that all movements have completed before something else happens. In order to do this I've been checking (DOTween.TotalPlayingTweens() == 0).

However, there are other tweens (for example fading in UI elements) which I need to run in parallel with the movements and not affect working out whether all of the movement tweens have completed.

I've tried to check IsPlaying() on MoveTween, as well as IsActive() and the ElapsedPercentage(), but none of these appear to be able to tell me whether all of the Tweens and Seqences in MoveTween are completed. I believe that it might be because when a tween is waiting on a pre-delay it isn't defined as "playing", perhaps?

Is there a simple way for me to determine when all of the tweens and sequences in MoveTween are done?

Re: Working out when tweens are no longer running
« Reply #1 on: April 16, 2016, 04:51:47 PM »
To follow up. For the moment I've resorted to counting the tweens manually. So when I have a new movement tween I increment a counter, and I append a callback to a method that decrements that count when the tween is done. This seems to work fine for my situation, but I'm curious whether there is any built-in functionality to give me the same result?