美文网首页
AnimationCurve+ lerp 做动画

AnimationCurve+ lerp 做动画

作者: aaa000 | 来源:发表于2021-11-16 17:52 被阅读0次

public AnimationCurve curve;

image.png

通过
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);

相关文章

网友评论

      本文标题:AnimationCurve+ lerp 做动画

      本文链接:https://www.haomeiwen.com/subject/vbghtrtx.html