The shortcuts way
代码语言:javascript复制transform.DOMoveX(2, 1).OnComplete(MoveComplete);
transform.DOMove(new Vector3(0, 100f, 0f), 2f, true);
第二种重载将transfrom移动到目标位置 动画结束将执行MoveComplete
设置延迟播放
代码语言:javascript复制Tween tween = transform.DOMove(new Vector3(0, 100f, 0f), 2f, true);
tween.SetDelay(2f);
设置循环播放
代码语言:javascript复制Tween tween = transform.DOLocalMove(new Vector3(0, 100f, 0f), 2f, true);
tween.SetLoops(2);
暂停播放
代码语言:javascript复制tween.Pause();
在播放未结束时反向播
代码语言:javascript复制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.