一、多段动画,重复执行
float secondDuration = 0.6f;
float firstDuration = 0.9f;
RectTransform rt = topImageTf.GetComponent<RectTransform>();
Vector2 start = rt.anchoredPosition;
Vector2 end = start + new Vector2(0, topOffset);
Sequence seq = DOTween.Sequence();
//动画一
seq.Append(rt.DOAnchorPos(start, firstDuration));
//动画二
seq.Append(rt.DOAnchorPos(end, secondDuration));
//重复播放
seq.SetLoops(-1, LoopType.Restart);
二、延迟,重复执行
Color endColor = color;
endColor.a = 0;
Image image = GetComponent<Image>();
Sequence seq1 = DOTween.Sequence();
seq1.AppendInterval(firstDuration); //延迟
seq1.Append(image.DOColor(endColor, secondDuration));
seq1.SetLoops(-1, LoopType.Restart);