docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class Light2D

    Class Light2D is a 2D light which can be used with the 2D Renderer.

    Inheritance
    object
    Object
    Component
    Behaviour
    MonoBehaviour
    Light2DBase
    Light2D
    Implements
    ISerializationCallbackReceiver
    Inherited Members
    MonoBehaviour.IsInvoking()
    MonoBehaviour.CancelInvoke()
    MonoBehaviour.Invoke(string, float)
    MonoBehaviour.InvokeRepeating(string, float, float)
    MonoBehaviour.CancelInvoke(string)
    MonoBehaviour.IsInvoking(string)
    MonoBehaviour.StartCoroutine(string)
    MonoBehaviour.StartCoroutine(string, object)
    MonoBehaviour.StartCoroutine(IEnumerator)
    MonoBehaviour.StopCoroutine(IEnumerator)
    MonoBehaviour.StopCoroutine(Coroutine)
    MonoBehaviour.StopCoroutine(string)
    MonoBehaviour.StopAllCoroutines()
    MonoBehaviour.print(object)
    MonoBehaviour.destroyCancellationToken
    MonoBehaviour.useGUILayout
    MonoBehaviour.didStart
    MonoBehaviour.didAwake
    MonoBehaviour.runInEditMode
    Behaviour.enabled
    Behaviour.isActiveAndEnabled
    Component.GetComponent(Type)
    Component.GetComponent<T>()
    Component.TryGetComponent(Type, out Component)
    Component.TryGetComponent<T>(out T)
    Component.GetComponent(string)
    Component.GetComponentInChildren(Type, bool)
    Component.GetComponentInChildren(Type)
    Component.GetComponentInChildren<T>(bool)
    Component.GetComponentInChildren<T>()
    Component.GetComponentsInChildren(Type, bool)
    Component.GetComponentsInChildren(Type)
    Component.GetComponentsInChildren<T>(bool)
    Component.GetComponentsInChildren<T>(bool, List<T>)
    Component.GetComponentsInChildren<T>()
    Component.GetComponentsInChildren<T>(List<T>)
    Component.GetComponentInParent(Type, bool)
    Component.GetComponentInParent(Type)
    Component.GetComponentInParent<T>(bool)
    Component.GetComponentInParent<T>()
    Component.GetComponentsInParent(Type, bool)
    Component.GetComponentsInParent(Type)
    Component.GetComponentsInParent<T>(bool)
    Component.GetComponentsInParent<T>(bool, List<T>)
    Component.GetComponentsInParent<T>()
    Component.GetComponents(Type)
    Component.GetComponents(Type, List<Component>)
    Component.GetComponents<T>(List<T>)
    Component.GetComponents<T>()
    Component.GetComponentIndex()
    Component.CompareTag(string)
    Component.CompareTag(TagHandle)
    Component.SendMessageUpwards(string, object, SendMessageOptions)
    Component.SendMessageUpwards(string, object)
    Component.SendMessageUpwards(string)
    Component.SendMessageUpwards(string, SendMessageOptions)
    Component.SendMessage(string, object)
    Component.SendMessage(string)
    Component.SendMessage(string, object, SendMessageOptions)
    Component.SendMessage(string, SendMessageOptions)
    Component.BroadcastMessage(string, object, SendMessageOptions)
    Component.BroadcastMessage(string, object)
    Component.BroadcastMessage(string)
    Component.BroadcastMessage(string, SendMessageOptions)
    Component.transform
    Component.gameObject
    Component.tag
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(object)
    Object.InstantiateAsync<T>(T)
    Object.InstantiateAsync<T>(T, Transform)
    Object.InstantiateAsync<T>(T, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int)
    Object.InstantiateAsync<T>(T, int, Transform)
    Object.InstantiateAsync<T>(T, int, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>)
    Object.InstantiateAsync<T>(T, int, Transform, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int, Transform, Vector3, Quaternion, CancellationToken)
    Object.InstantiateAsync<T>(T, int, Transform, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>)
    Object.InstantiateAsync<T>(T, int, Transform, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>, CancellationToken)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Scene)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, bool)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, bool)
    Object.Destroy(Object, float)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, bool)
    Object.DestroyImmediate(Object)
    Object.FindObjectsByType(Type, FindObjectsSortMode)
    Object.FindObjectsByType(Type, FindObjectsInactive, FindObjectsSortMode)
    Object.DontDestroyOnLoad(Object)
    Object.FindObjectsByType<T>(FindObjectsSortMode)
    Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
    Object.FindFirstObjectByType<T>()
    Object.FindAnyObjectByType<T>()
    Object.FindFirstObjectByType<T>(FindObjectsInactive)
    Object.FindAnyObjectByType<T>(FindObjectsInactive)
    Object.FindFirstObjectByType(Type)
    Object.FindAnyObjectByType(Type)
    Object.FindFirstObjectByType(Type, FindObjectsInactive)
    Object.FindAnyObjectByType(Type, FindObjectsInactive)
    Object.ToString()
    Object.name
    Object.hideFlags
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.Rendering.Universal
    Assembly: Unity.RenderPipelines.Universal.2D.Runtime.dll
    Syntax
    [ExecuteAlways]
    [DisallowMultipleComponent]
    [MovedFrom(true, "UnityEngine.Experimental.Rendering.Universal", "Unity.RenderPipelines.Universal.Runtime", null)]
    [AddComponentMenu("Rendering/2D/Light 2D")]
    [HelpURL("https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@latest/index.html?subfolder=/manual/2DLightProperties.html")]
    public sealed class Light2D : Light2DBase, ISerializationCallbackReceiver

    Properties

    blendStyleIndex

    The lights current operation index

    Declaration
    public int blendStyleIndex { get; set; }
    Property Value
    Type Description
    int

    color

    The lights current color

    Declaration
    public Color color { get; set; }
    Property Value
    Type Description
    Color

    falloffIntensity

    Controls the brightness and distance of the fall off (edge) of the light

    Declaration
    public float falloffIntensity { get; set; }
    Property Value
    Type Description
    float

    intensity

    The lights current intensity

    Declaration
    public float intensity { get; set; }
    Property Value
    Type Description
    float

    lightCookieSprite

    The Sprite that's used by the Sprite Light type to control the shape light

    Declaration
    public Sprite lightCookieSprite { get; set; }
    Property Value
    Type Description
    Sprite

    lightOrder

    Gets or sets the light order. The lightOrder determines the order in which the lights are rendered onto the light textures.

    Declaration
    public int lightOrder { get; set; }
    Property Value
    Type Description
    int

    lightType

    The light's current type

    Declaration
    public Light2D.LightType lightType { get; set; }
    Property Value
    Type Description
    Light2D.LightType

    normalMapDistance

    The simulated z distance of the light from the surface used in normal map calculation.

    Declaration
    public float normalMapDistance { get; }
    Property Value
    Type Description
    float

    normalMapQuality

    Returns the calculation quality for the normal map rendering. Please refer to NormalMapQuality.

    Declaration
    public Light2D.NormalMapQuality normalMapQuality { get; }
    Property Value
    Type Description
    Light2D.NormalMapQuality

    overlapOperation

    Controls the overlap operation mode.

    Declaration
    public Light2D.OverlapOperation overlapOperation { get; set; }
    Property Value
    Type Description
    Light2D.OverlapOperation

    pointLightInnerAngle

    The inner angle of the point light shape. The bigger the angle, the wider the gap. The gap between the innner and outer angle will determine the size of the light's penumbra.

    Declaration
    public float pointLightInnerAngle { get; set; }
    Property Value
    Type Description
    float

    pointLightInnerRadius

    The radius of the inner light area that has full brightness. The gap between the inner and outer radius will determine the size of the light's penumbra.

    Declaration
    public float pointLightInnerRadius { get; set; }
    Property Value
    Type Description
    float

    pointLightOuterAngle

    The angle that determins the shape of the inner light area. The gap between the innner and outer angle will determine the size of the light's penumbra.

    Declaration
    public float pointLightOuterAngle { get; set; }
    Property Value
    Type Description
    float

    pointLightOuterRadius

    The outer radius that determines the size of the light. The gap between the inner and outer radius will determine the size of the light's penumbra.

    Declaration
    public float pointLightOuterRadius { get; set; }
    Property Value
    Type Description
    float

    renderVolumetricShadows

    Returns if volumetric shadows should be rendered.

    Declaration
    public bool renderVolumetricShadows { get; }
    Property Value
    Type Description
    bool

    shadowIntensity

    Specifies the darkness of the shadow

    Declaration
    public float shadowIntensity { get; set; }
    Property Value
    Type Description
    float

    shadowSoftness

    Specifies the softness of the soft shadow

    Declaration
    public float shadowSoftness { get; set; }
    Property Value
    Type Description
    float

    shadowSoftnessFalloffIntensity

    Controls the falloff for soft shadows

    Declaration
    public float shadowSoftnessFalloffIntensity { get; set; }
    Property Value
    Type Description
    float

    shadowVolumeIntensity

    Specifies the darkness of the shadow

    Declaration
    public float shadowVolumeIntensity { get; set; }
    Property Value
    Type Description
    float

    shadowsEnabled

    Specifies that the shadows are enabled

    Declaration
    public bool shadowsEnabled { get; set; }
    Property Value
    Type Description
    bool

    shapeLightFalloffSize

    The size of the fall-off area. Bigger value corresponds to bigger fall off size.

    Declaration
    public float shapeLightFalloffSize { get; set; }
    Property Value
    Type Description
    float

    shapeLightParametricAngleOffset

    The offset of the shape from the light's origin.

    Declaration
    public float shapeLightParametricAngleOffset { get; }
    Property Value
    Type Description
    float

    shapeLightParametricRadius

    The size of the shape.

    Declaration
    public float shapeLightParametricRadius { get; }
    Property Value
    Type Description
    float

    shapeLightParametricSides

    The number of sides in the parametric shape.

    Declaration
    public int shapeLightParametricSides { get; }
    Property Value
    Type Description
    int

    shapePath

    Returns the path that represents the shape light. Values are in object space.

    Declaration
    public Vector3[] shapePath { get; }
    Property Value
    Type Description
    Vector3[]

    volumeIntensity

    Controls the visibility of the light's volume

    Declaration
    public float volumeIntensity { get; set; }
    Property Value
    Type Description
    float

    volumetricEnabled

    Enables or disables the light's volume

    Declaration
    public bool volumetricEnabled { get; set; }
    Property Value
    Type Description
    bool

    volumetricShadowsEnabled

    Specifies that the volumetric shadows are enabled

    Declaration
    public bool volumetricShadowsEnabled { get; set; }
    Property Value
    Type Description
    bool

    Methods

    OnAfterDeserialize()

    OnAfterSerialize implementation.

    Declaration
    public void OnAfterDeserialize()

    OnBeforeSerialize()

    OnBeforeSerialize implementation.

    Declaration
    public void OnBeforeSerialize()

    SetShapePath(Vector3[])

    Set the shape that represents the freeform light. Values are in object space.

    Declaration
    public void SetShapePath(Vector3[] path)
    Parameters
    Type Name Description
    Vector3[] path

    Array of Vector3 defining the shape.

    Implements

    ISerializationCallbackReceiver
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)