纳金网
标题:
unity3D-------灯光强弱控制
[打印本页]
作者:
yeu1233
时间:
2012-8-24 15:32
标题:
unity3D-------灯光强弱控制
直接把一下代码加到灯光中,
private var scrollPos : float = 1.0;
private var lightObject : Light;
public var skyBoxMaterial : Material;
function Start()
{
lightObject
= GetComponent(Light);
}
function Update () {}
function
OnGUI()
{
GUI.Window(100,Rect(0,0,280,40),LightWindow,"Ligh");
}
function
LightWindow(windowId : int)
{
scrollPos = GUI.HorizontalSlider (Rect
(5,20,255,20), scrollPos, 0.0, 2.0); lightObject.color = Color
(scrollPos, scrollPos,
scrollPos);
//Debug.Log(lightObject.color);
}
@script
RequireComponent(Light)
-------------------------------
(gzpyming )
欢迎光临 纳金网 (http://old.narkii.com/club/)
Powered by Discuz! X2.5