public AnimationCurve curve;

通过
x = Time.deltaTime; x轴匀速变化
y = curve.Evalute(x); 来获取 Y轴上的数字!
//通过下面的lerp比例的方式 移动物体 不能超过终点 (y值超过1时 返回1)
this.transform.position = Vertor3.Lerp(起点,终点,比例y值);
//通过下面的LerpUnclamped的方式移动物体 可以超过终点再回来
this.transform.position = Vertor3.LerpUnclamped(起点,终点,比值y);
网友评论