一、多段动画,重复播放
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);
网友评论