Hello and thanks for making this awesome tool so awesome!
I have been using DOTween alot but have run into some problems wrapping my head around how to use and control tweens in sequences.
I want to be able to define tweens and then insert them into a Sequence to manage them all at once using .Kill() / .Pause() / etc on the sequence rather than having to do that on every tween. Not being a very good programmer I need to trial and error myself forward and sometimes it works sometimes it don't, - my problem is I don't know why?
So if someone could enlighten me why, for example, is the below code not performing as 'intended' (and instead ignoring the AppendIntervals & Not Pausing)?
Sequence mySequence = DOTween.Sequence();
Tween anchorMinTween = null;
Tween anchorMaxTween = null;
Tween anchorPositionTween = null;
Tween scaleTween = null;
void PlayTween()
{
anchorMaxTween = DOTween.To(() => rectTrans.anchorMax, v => rectTrans.anchorMax = v, new Vector2(0.5f,0.5f), 1f)
// .Pause()
.SetDelay(2f)
;
anchorMinTween = DOTween.To(() => rectTrans.anchorMin, v => rectTrans.anchorMin = v, new Vector2(0.5f, 0.5f), 1f)
// .Pause()
.SetDelay(2f)
;
anchorPositionTween = DOTween.To(() => rectTrans.anchoredPosition, v => rectTrans.anchoredPosition = v, Vector2.zero, 1f)
//.Pause()
.SetDelay(2f)
;
scaleTween = DOTween.To(() => rectTrans.localScale, v => rectTrans.localScale = v, Vector3.zero, 1f)
//.Pause()
.SetDelay(2f)
;
mySequence
.AppendInterval(5f)
.Append(anchorMaxTween)
.Join(anchorMinTween)
.Join(anchorPositionTween)
.AppendInterval(2f)
.Append(scaleTween)
//.SetDelay(2f)
//.Play()
.Pause()
;
}
}
I'm probably missing something fundamental, but I have been looking to find a solution to what's wrong in my thinking for days and feel I need some pro directions
Thanks again!
Cheers!!