鸟语天空
Mathf.Lerp
post by:追风剑情 2014-7-4 0:14
using UnityEngine;
using System.Collections;

public class MathfLerp : MonoBehaviour {

	public float from = 0.0F;
	public float to = 6.0F;
	
	// Update is called once per frame
	void Update () {
		//当t=0返回from, 当t=1返回to, 当t>0 and t<1 返回from+(to-from)*t的值。
		transform.position = new Vector3(Mathf.Lerp(from, to, Time.time), 0, 0);
	}
}
评论:
发表评论:
昵称

邮件地址 (选填)

个人主页 (选填)

内容