Skip to main content

Light

info

Light inherits from Behaviour

Script 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.
Check out Unity Light API

Members

Properties

NameDescription
Light.areaSizeThe size of the area light (Editor only).
Light.bakingOutputThis property describes the output of the last Global Illumination bake.
Light.bounceIntensityThe multiplier that defines the strength of the bounce lighting.
Light.boundingSphereOverrideBounding sphere used to override the regular light bounding sphere during culling.
Light.colorThe color of the light.
Light.commandBufferCountNumber of command buffers set up on this light (Read Only).
Light.cookieThe cookie texture projected by the light.
Light.cookieSizeThe size of a directional light's cookie.
Light.cullingMaskThis is used to light certain objects in the Scene selectively.
Light.flareThe flare asset to use for this light.
Light.innerSpotAngleThe angle of the light's spotlight inner cone in degrees.
Light.intensityThe Intensity of a light is multiplied with the Light color.
Light.layerShadowCullDistancesvPer-light, per-layer shadow culling distances.
Light.rangeThe range of the light.
Light.renderingLayerMaskDetermines which rendering LayerMask this Light affects.
Light.renderModeHow to render the light.
Light.shadowAngleControls the amount of artificial softening applied to the edges of shadows cast by directional lights.
Light.shadowBiasShadow mapping constant bias.
Light.shadowCustomResolutionThe custom resolution of the shadow map.
Light.shadowMatrixOverrideProjection matrix used to override the regular light matrix during shadow culling.
Light.shadowNearPlaneNear plane value to use for shadow frustums.
Light.shadowNormalBiasShadow mapping normal-based bias.
Light.shadowRadiusControls the amount of artificial softening applied to the edges of shadows cast by the Point or Spot light.
Light.shadowResolutionThe resolution of the shadow map.
Light.shadowsHow this light casts shadows
Light.shapeThis property describes the shape of the spot light. Only Scriptable Render Pipelines use this property; the built-in renderer does not support it.
Light.spotAngleThe angle of the light's spotlight cone in degrees.
Light.typeThe type of the light.
Light.useBoundingSphereOverrideSet to true to override light bounding sphere for culling.
Light.useColorTemperatureSet to true to use the color temperature.
Light.useShadowMatrixOverrideSet to true to enable custom matrix for culling during shadows.

Inherited Members

Inherited Properties

NameDescription
Light.enabledEnabled Behaviours are Updated, disabled Behaviours are not.
Light.isActiveAndEnabledHas the Behaviour had active and enabled called?
Light.gameObjectThe game object this component is attached to. A component is always attached to a game object.
Light.tagThe tag of this game object.
Light.transformThe Transform attached to this GameObject.
Light.hideFlagsShould the object be hidden, saved with the Scene or modifiable by the user?
Light.nameThe name of the object.

Inherited Methods

NameDescription
Light.BroadcastMessage(methodName, parameter=nil)Calls the method named methodName on every Lua Script in this game object or any of its children.
Light.CompareTag(tag)Is this game object tagged with tag ?
Light.GetAllLuaScripts()Returns an array of all Lua scripts that attached to the game object.
Light.GetComponent(type)Returns the component of Type type if the game object has one attached, nil if it doesn't.
Light.GetComponentInChildren(t)Returns the component of Type type in the GameObject or any of its children using depth first search.
Light.GetComponentInParent(t)Returns the component of Type type in the GameObject or any of its parents.
Light.GetComponents(type)Returns all components of Type type in the GameObject.
Light.GetComponentsInChildren(t)Returns all components of Type type in the GameObject or any of its children.
Light.GetComponentsInParent(t)Returns all components of Type type in the GameObject or any of its parents.
Light.SendMessage(methodName, value=nil)Calls the method named methodName on every Lua Script in this game object.
Light.SendMessageUpwards(methodName, value=nil)Calls the method named methodName on every LuaScript in this game object and on every ancestor of the behaviour.
Light.TryGetComponent(type)Gets the component of the specified type, if it exists.
Light.GetInstanceID()Returns the instance id of the object.