Unity随时间改变光照强度
// Pulse light's intensity over time
//随时间改变光照强度
var duration : float= 1.0;
function Update() {
// argument for cosine
//余弦理论
var phi : float = Time.time / duration * 2 * Mathf.PI;
// get cosine and transform from -1..1 to 0..1 range
//获取余弦,并将范围从-1~1变为0~1
var amplitude : float = Mathf.Cos( phi ) * 0.5 + 0.5;
// set light color
//设置灯光颜色
light.intensity = amplitude;
} 谢谢分享 很不错 楼主是超人 好帖就是要顶 真心顶 难得一见的好帖 好帖就是要顶 顶顶多好 说的非常好
页:
[1]