--the below script will make the object Enable/Disable it's Light component--[Add "light" reference to the Scripting Runtime component]thisGameObject = Space.Host.ExecutingObjectlight = Space.Host.GetReference("light").LightOnClick=function()light.Enabled =not light.EnabledendthisGameObject.AddClickable()thisGameObject.Clickable.OnClick(OnClick)
Range
float Rangegetset
Get/Set the effective range of the light source.
Space.Host.ExecutingObject.Light.Range =8.0
--the below script will make a slider set the Light's range--[Add "slider" and "light" references to the Scripting Runtime component]light = Space.Host.GetReference("light").Lightslider = Space.Host.GetReference("slider").UISliderOVC=function()light.Range = (slider.Value *100) --(from 0 to 100)endslider.OnValueChanged(OVC)
SpotAngle
float SpotAnglegetset
The angle of the light's spotlight cone in degrees.
Space.Host.ExecutingObject.Light.SpotAngle =50
--the below script will make a slider set the Light's Spot Angle--[Add "slider" and "light" references to the Scripting Runtime component]light = Space.Host.GetReference("light").Lightslider = Space.Host.GetReference("slider").UISliderlight.Type =2--it has to be Spot type OVC=function()light.SpotAngle = (slider.Value *178) +1--(from 1 to 179)endslider.OnValueChanged(OVC)
--the below script will make a slider set the Light's Intensity--[Add "slider" and "light" references to the Scripting Runtime component]light = Space.Host.GetReference("light").Lightslider = Space.Host.GetReference("slider").UISliderOVC=function()light.Intensity = (slider.Value *8) --(from 0 to 8)endslider.OnValueChanged(OVC)
--clicking the object will open a color picker that changes Light's color----[Add "light" reference to the Scripting Runtime component]thisGameObject = Space.Host.ExecutingObjectlight = Space.Host.GetReference("light").LightOnChange=function(SColor) light.Color = SColorendOnSelect=function(SColor) light.Color = SColorendOnCancel=function()endOnClick=function()Space.Dialogues.ColorPicker("Pick a color","Ok", OnChange, OnSelect, OnCancel, Color.Red)endthisGameObject.AddClickable()thisGameObject.Clickable.OnClick(OnClick)
Type
int Typegetset
Get/Set the type of light this source is. 0 = Directional, 1 = Point, 2 = Spot, 3 = Area.
Space.Host.ExecutingObject.Light.Type =0
--Clicking the object toggles between the 4 different light types--[Add "light" reference to the Scripting Runtime component]thisGameObject = Space.Host.ExecutingObjectlight = Space.Host.GetReference("light").LightOnClick=function()if light.Type ==3then light.Type =0else light.Type = light.Type +1endendthisGameObject.AddClickable()thisGameObject.Clickable.OnClick(OnClick)