The angle of the light's spotlight cone in degrees.
This is used primarily for Spot lights and has no effect for Point lights See Also: Light component.
// Change spot angle randomly between 'minAngle' and 'maxAngle' // each 'interval' seconds.
var interval : float = 0.3; var minAngle : float = 10; var maxAngle : float = 90; var timeLeft : float;
var lt: Light;
function Start() { lt = GetComponent.<Light>(); lt.type = LightType.Spot;
timeLeft = interval; }
function Update () { timeLeft -= Time.deltaTime;
if (timeLeft < 0.0) { // time to change! timeLeft = interval; lt.spotAngle = Random.Range(minAngle, maxAngle); } }
no example available in C#
Did you find this page useful? Please give it a rating: