Scripting API

Light2D

class in UnityEngine.Rendering.Universal · Unity.RenderPipelines.Universal.2D.Runtime · inherits from MonoBehaviour

35 of 35 of Unity's members
In Tassix

A light for URP's 2D renderer: global, point (and spot), freeform or parametric (a regular polygon), lighting sprites with a 2D lit shader on its target sorting layers through one of the renderer's blend styles (multiply, additive, and the two with a mask). Its shadows dim it behind ShadowCaster2D outlines (softened by shadowSoftness), and with normal map quality on it shades by the sprites' normals. Sprite lights draw their cookie sprite's colors over the sprite's shape; a point light's cookie tints it over its outer radius. Volumetric light is settings only.

Properties 31

bool alphaBlendOnOverlap { get; }
int blendStyleIndex { get; set; }
Color color { get; set; }
float falloffIntensity { get; set; }
float intensity { get; set; }
Sprite? lightCookieSprite { get; set; }
int lightOrder { get; set; }
LightType lightType { get; set; }
float normalMapDistance { get; }
NormalMapQuality normalMapQuality { get; }
OverlapOperation overlapOperation { get; set; }
float pointLightInnerAngle { get; set; }
float pointLightInnerRadius { get; set; }
float pointLightOuterAngle { get; set; }
float pointLightOuterRadius { get; set; }
bool renderVolumetricShadows { get; }
float shadowIntensity { get; set; }
float shadowSoftness { get; set; }
float shadowSoftnessFalloffIntensity { get; set; }
float shadowVolumeIntensity { get; set; }
bool shadowsEnabled { get; set; }
float shapeLightFalloffSize { get; set; }
float shapeLightParametricAngleOffset { get; }
float shapeLightParametricRadius { get; }
int shapeLightParametricSides { get; }
Vector3[]? shapePath { get; }
int[]? targetSortingLayers { get; set; }
float volumeIntensity { get; set; }
bool volumeIntensityEnabled { get; set; }
bool volumetricEnabled { get; set; }
bool volumetricShadowsEnabled { get; set; }

Methods 5

bool AddTargetSortingLayer(string layerName)
bool AddTargetSortingLayer(int layerID)
void OnAfterDeserialize()
void OnBeforeSerialize()
bool RemoveTargetSortingLayer(string layerName)
bool RemoveTargetSortingLayer(int layerID)
void SetShapePath(Vector3[] path)

Checked against Unity

Conformance scenarios that exercise it, recorded in Unity and compared event by event.