Mathf.Lerp

作者:追风剑情 发布于:2014-7-4 0:14 分类:Unity3d

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);
	}
}

标签: Lerp

Powered by emlog  蜀ICP备18021003号-1   sitemap

川公网安备 51019002001593号