教程地址:
功能说明:灯光逐渐变亮
private Light myLight;
void Start () {
myLight = GetComponent<Light>();
}
// This would mean the change to intensity would happen per second instead of per frame.
void Update () {
myLight.intensity = Mathf.Lerp(myLight.intensity, 8f, 0.5f * Time.deltaTime);
}
用法解释:
例子1:
// In this case, result = 4
float result = Mathf.Lerp (3f, 5f, 0.5f);
Linearly interpolating is finding a value that is some percentage between two given values.
F