using System.Collections;
using System.Collections.Generic;
using System.Linq;
using DG.Tweening;
using UnityEngine;
public class PathManager : MonoBehaviour
{
public Transform[] Pos;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
void 路径移动()
{
//路径点数组
var positions = Pos.Select(u => u.position).ToArray();
/*
参数一:路径点 数组
参数二:完成动画需要 多少秒
参数三:路径的弧度是曲线还是直线
参数四:路径模式 Full3D
参数五:路径点的精密度 数值越大越精密
参数六:路径线路的颜色
SetOptions(true) 路径从头回到原点
SetLookAt(0) 路径物体与路径点保持的夹角 取值范围0-1
SetLoops(-1) -1无限循环 循环的次数
SetEase(Ease.Linear) 匀速线性运动
*/
transform.DOPath(positions, 10, PathType.Linear, PathMode.Full3D, 100, Color.yellow)
.SetOptions(true).SetLookAt(0)
Unity_DoTween_Path路径动画的使用
于 2019-12-19 17:49:44 首次发布