- 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)
复制代码 |