函数学习

来源:互联网 发布:淘宝会员中心 编辑:程序博客网 时间:2024/05/29 14:28


Vector3.Lerp

            transform.position = Vector3.Lerp(transform.position, target, Time.deltaTime * speed);  // 第三个参数的值限制为[0,1],小于0即为0,大于1为1。当前帧移动的距离为:第三个参数 * 总距离,如第三个参数为0.5,一帧就是移动一半的距离。如果距离小于0.1,好像是默认一帧移动完




原创粉丝点击