Light Class, inherits from BehaviourScripting > Runtime Classes > LightScript interface for light components. Use this to control all aspects of Unity's lights. The properties are an exact match for the values shown in the Inspector. Usually lights are just created in the editor but sometimes you want to create a light from a script: function Start () {
// Make a game object var lightGameObject = new GameObject ("The Light"); // Add the light component lightGameObject.AddComponent (Light); // Set color and position lightGameObject.light.color = Color.blue; // Set the position (or any transform property) after // adding the light component. lightGameObject.transform.position = Vector3 (0, 5, 0); } Variables
Inherited members
Inherited Variables
Inherited Functions
Inherited Class Functions
|