pub struct Light {Show 31 fields
pub m_Color: ColorRGBA,
pub m_Cookie: PPtr,
pub m_CookieSize: f32,
pub m_CullingMask: BitField,
pub m_DrawHalo: bool,
pub m_Enabled: u8,
pub m_Flare: PPtr,
pub m_GameObject: PPtr,
pub m_Intensity: f32,
pub m_Lightmapping: i32,
pub m_Range: f32,
pub m_RenderMode: i32,
pub m_Shadows: ShadowSettings,
pub m_SpotAngle: f32,
pub m_Type: i32,
pub m_ActuallyLightmapped: Option<bool>,
pub m_AreaSize: Option<Vector2f>,
pub m_BakedIndex: Option<i32>,
pub m_BakingOutput: Option<LightBakingOutput>,
pub m_BounceIntensity: Option<f32>,
pub m_BoundingSphereOverride: Option<Vector4f>,
pub m_CCT: Option<f32>,
pub m_ColorTemperature: Option<f32>,
pub m_FalloffTable: Option<FalloffTable>,
pub m_InnerSpotAngle: Option<f32>,
pub m_LightShadowCasterMode: Option<i32>,
pub m_RenderingLayerMask: Option<u32>,
pub m_Shape: Option<i32>,
pub m_UseBoundingSphereOverride: Option<bool>,
pub m_UseColorTemperature: Option<bool>,
pub m_UseViewFrustumForShadowCasterCull: Option<bool>,
}Expand description
Light is a class of the Unity engine since version 3.4.0. Exert from Unity’s scripting documentation: 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.Usually lights are just created in the editor but sometimes you want to create a light from a script:
Fields§
§m_Color: ColorRGBAThe color of the light.
m_Cookie: PPtrThe cookie texture projected by the light.
PPtr<Texture>: (3.4.0 - 2022.3.2f1)
m_CookieSize: f32The size of a directional light’s cookie.
m_CullingMask: BitFieldThis is used to light certain objects in the Scene selectively.
m_DrawHalo: bool§m_Enabled: u8Enabled Behaviours are Updated, disabled Behaviours are not.
m_Flare: PPtrThe flare asset to use for this light.
PPtr<Flare>: (3.4.0 - 2022.3.2f1)
m_GameObject: PPtrThe game object this component is attached to. A component is always attached to a game object.
PPtr<GameObject>: (3.4.0 - 2022.3.2f1)
m_Intensity: f32The Intensity of a light is multiplied with the Light color.
m_Lightmapping: i32§m_Range: f32The range of the light.
m_RenderMode: i32How to render the light.
m_Shadows: ShadowSettingsHow this light casts shadows
m_SpotAngle: f32The angle of the light’s spotlight cone in degrees.
m_Type: i32The type of the light.
m_ActuallyLightmapped: Option<bool>bool: (3.4.0 - 5.3.8f2)
m_AreaSize: Option<Vector2f>The size of the area light (Editor only). Vector2f: (5.4.0f3 - 2022.3.2f1)
m_BakedIndex: Option<i32>i32: (5.4.0f3 - 5.6.0b1)
m_BakingOutput: Option<LightBakingOutput>This property describes the output of the last Global Illumination bake. LightBakingOutput: (5.6.0f1 - 2022.3.2f1)
m_BounceIntensity: Option<f32>The multiplier that defines the strength of the bounce lighting. f32: (5.0.0f4 - 2022.3.2f1)
m_BoundingSphereOverride: Option<Vector4f>Bounding sphere used to override the regular light bounding sphere during culling. Vector4f: (2019.1.0f2 - 2022.3.2f1)
m_CCT: Option<f32>f32: (5.6.0b1 - 5.6.0b9)
m_ColorTemperature: Option<f32>The color temperature of the light. Correlated Color Temperature (abbreviated as CCT) is multiplied with the color filter when calculating the final color of a light source. The color temperature of the electromagnetic radiation emitted from an ideal black body is defined as its surface temperature in Kelvin. White is 6500K according to the D65 standard. A candle light is 1800K and a soft warm light bulb is 2700K. If you want to use colorTemperature, GraphicsSettings.lightsUseLinearIntensity and Light.useColorTemperature has to be enabled. See Also: GraphicsSettings.lightsUseLinearIntensity, GraphicsSettings.useColorTemperature. f32: (5.6.0f1 - 2022.3.2f1)
m_FalloffTable: Option<FalloffTable>FalloffTable: (2017.1.0b1 - 2017.1.0b10)
m_InnerSpotAngle: Option<f32>The angle of the light’s spotlight inner cone in degrees. f32: (2019.1.0b1 - 2022.3.2f1)
m_LightShadowCasterMode: Option<i32>Allows you to override the global Shadowmask Mode per light. Only use this with render pipelines that can handle per light Shadowmask modes. Incompatible with the legacy renderers. i32: (2018.2.0b1 - 2022.3.2f1)
m_RenderingLayerMask: Option<u32>Determines which rendering LayerMask this Light affects. u32: (2019.1.0f2 - 2022.3.2f1)
m_Shape: Option<i32>This property describes the shape of the spot light. Only Scriptable Render Pipelines use this property; the built-in renderer does not support it. i32: (2019.3.0b1 - 2022.3.2f1)
m_UseBoundingSphereOverride: Option<bool>Set to true to override light bounding sphere for culling. bool: (2019.1.0f2 - 2022.3.2f1)
m_UseColorTemperature: Option<bool>Set to true to use the color temperature. bool: (5.6.0f1 - 2022.3.2f1)
m_UseViewFrustumForShadowCasterCull: Option<bool>Whether to cull shadows for this Light when the Light is outside of the view frustum. bool: (2020.2.0b1 - 2022.3.2f1)