当调用TweenPosition.Begin()时,gameObject会被自动挂上TweenPosition脚本
//让gameObject在20内移到坐标(4, 0, 0)
TweenPosition tween = TweenPosition.Begin(gameObject, 20, new Vector3(4, 0, 0));
tween.PlayForward();
//若想在中途停止移动
TweenPosition tween = gameObject.GetComponent<TweenPosition>();
tween.enabled = false;
就是这么简单。
本文介绍了如何使用TweenPosition组件来实现游戏对象平滑移动到指定位置的功能。通过Begin方法启动移动,并展示了如何在过程中暂停移动。
4173

被折叠的 条评论
为什么被折叠?



