首页 > 编程语言 > 详细

Unity Mathf

时间:2015-05-11 11:03:30      阅读:481      评论:0      收藏:0      [点我收藏+]

1、Lerp 线性移动

float startTime = 1f;//动画持续的时间为1秒
//start开始状态
//end结束状态
//startTime为持续的时间
float current = Mathf.Lerp/LerpAngle(start, end, Time.time - startTime)

使用方法

public void Update() {
    transform.position = new Vecter3(Mathf.Lerp(start,end,Time.time - startTime),...y,...z);
}

2、LerpAngle

使用方法

public void Update() {
    transform.eulerAngles = new Vecter3(...x,current , ...z);
}

3、MoveTowards

匀速运动

public void Update() {
    //speed速度
    transform.eulerAngles = new Vecter3(...x,Mathf.MoveTowards(satrt,end,speed) , ...z);
}


Unity Mathf

原文:http://my.oschina.net/u/1273583/blog/413150

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!