Skip to content

Light

extends Component

The Light class is used to control lights.

You can obtain the Light component in the following way:

typescript
let obj = new GameObject();
let light = obj.AddComponent<Light>(Light);

成员变量

Light.type : LightType
Light source type.
Light.color : Color
The color of the light source.
Light.intensity : number
The intensity of the light source.
Light.range : number
Light Range.
Light.innerAngle : number
The angle of the spotlight cone for a light source, in degrees.
Light.shadowStrength : number
The intensity of the light shadow.
Light.outerAngle : number
The external angle of the light source.
Light.shadowType : ShadowType
Light shadow types.
Light.shadowCastLayerMask : number
The rendering LayerMask affected by light and shadows.