Unity-DOTween

The shortcuts way

transform.DOMoveX(2, 1).OnComplete(MoveComplete);

transform.DOMove(new Vector3(0, 100f, 0f), 2f, true);

第二种重载将transfrom移动到目标位置
动画结束将执行MoveComplete

设置延迟播放

Tween tween = transform.DOMove(new Vector3(0, 100f, 0f), 2f, true);
        tween.SetDelay(2f);

设置循环播放

Tween tween = transform.DOLocalMove(new Vector3(0, 100f, 0f), 2f, true);
        tween.SetLoops(2);

暂停播放

tween.Pause();

在播放未结束时反向播

tween.PlayBackwards();

Each of these shortcuts also has a FROM alternate version except where indicated. Just chain a [From](javascript:void(0)) to a Tweener to make the tween behave as a FROM tween instead of a TO tween.

你可能感兴趣的:(Unity-DOTween)