1
DOTween & DOTween Pro / Reusing sequences
« on: December 11, 2015, 11:51:17 PM »
I have a bit of a unique use case that I'm trying to get to work with DOTween Pro and the visual editor. I'm building an animation sequence tool (called SequenceManager from now on) that allows me to chain Unity animations and DOTweens, while syncing audio playback. Users specify an animation sequence length, and a type for each sequence (Unity animation or DOTween). If the user selects DOTween, they can specify the number of DOTweenAnimations for this stage of the sequence (see the attached screen shot). User's would then add a DOTweenAnimation script to the component, and drag that script into the SequenceManager to create a reference.
Once the SequenceManager Start function is called, I call DOTween.Sequence() and append the tween from each DOTweenAnimation for my animation sequence. Everything works great the first time I execute the DOTween Sequence. Tweens have AutoPlay and AutoKill disabled so that I can control when to trigger playback and to replay the tweens. However, on replaying the tweens I have a problem.
All my Move tweens start from the ORIGINAL location of the gameobject transform they are attached to. So, let's say I have an object at (0,0,0) and I tween to (50,50,0). Once the tween is done, I set the gameobject's position to be (100,50,0). If I restart my tween, instead of starting at (100,50,0) and tweening to (50,50,0), my game object starts at (0,0,0) and tweens to (50,50,0).
Is it possible to configure a reusable sequence such that tweens begin in the current state of a game object, instead of the original state of the game object? If so, what do I have to do to make this happen?
The main reason I purchased the DOTween Pro was to utilize the visual tween editor, but it seems like the only way to do what I want is by constructing new tweens in code everytime I need a new sequence. Is there something that I am missing?
Thank you!
Once the SequenceManager Start function is called, I call DOTween.Sequence() and append the tween from each DOTweenAnimation for my animation sequence. Everything works great the first time I execute the DOTween Sequence. Tweens have AutoPlay and AutoKill disabled so that I can control when to trigger playback and to replay the tweens. However, on replaying the tweens I have a problem.
All my Move tweens start from the ORIGINAL location of the gameobject transform they are attached to. So, let's say I have an object at (0,0,0) and I tween to (50,50,0). Once the tween is done, I set the gameobject's position to be (100,50,0). If I restart my tween, instead of starting at (100,50,0) and tweening to (50,50,0), my game object starts at (0,0,0) and tweens to (50,50,0).
Is it possible to configure a reusable sequence such that tweens begin in the current state of a game object, instead of the original state of the game object? If so, what do I have to do to make this happen?
The main reason I purchased the DOTween Pro was to utilize the visual tween editor, but it seems like the only way to do what I want is by constructing new tweens in code everytime I need a new sequence. Is there something that I am missing?
Thank you!