Mathf.Lerp详解
时间: 2020-05-12来源:OSCHINA
前景提要
常用于摄像机追随玩家 实现平滑跟踪
void Update () {
if (player != null) {
float x = Mathf.Lerp (this.transform.position.x , player.position.x , 0.2f);
float y = Mathf.Lerp (this.transform.position.y , player.position.y , 0.2f);
this.transform.position = new Vector3 (x , y , this.transform.position.z);
}
}

科技资讯:

科技学院:

科技百科:

科技书籍:

网站大全:

软件大全:

热门排行