Documentation

Overview

Add a Light2dSource or Light2dMask component to the object you want to make it into a light.

Scripts/Core/Light2DBase.cs

Base class of ‘Light2dSource’ and ‘Light2dMask’. It contains.

Scripts/Light2DSource.cs

Render light. Light be blocked by objects with colliders.

Scripts/Light2DMask.cs

Makes invisible light and responds to the Sprite component’s ‘Mask Interaction’ property.

 

Components

Light2DSource.cs

The Light2DSource component has following options.

PropertyFunction
SpriteThe Sprite object to render. 
ColorVertex color of the rendered light mesh.
RadiusMaximum distance the light can reach.
AngleAngle at which the light is distributed or emitted.
RotationRotation of the rendered light in z coordinates.
ResolutionSpecifies dense the beams of light is at an angle with no object.
LayerMaskSpecifies the layer that objects to collide with light.
Send Event MessageSend ‘OnEnterLight2d()’, ‘OnExitLight2D’ events to objects. 
Automatic UpdateIt automatically updates the geometry of light every frame. To do this manually, you can call UpdateGeometry().
ExcuteInEditorUpdates the geometry of light in editor mode.

Light2DMask.cs

The Light2DMask component has following options.

PropertyFunction
SpriteThe Sprite object to render. 
ColorVertex color of the rendered light mesh.
RadiusMaximum distance the light can reach.
AngleAngle at which the light is distributed or emitted.
RotationRotation of the rendered light in z coordinates.
ResolutionSpecifies dense the beams of light is at an angle with no object.
LayerMaskSpecifies the layer that objects to collide with light.
Send Event MessageSend ‘OnEnterLight2d()’, ‘OnExitLight2D’ events to objects. 
Automatic UpdateIt automatically updates the geometry of light every frame. To do this manually, you can call UpdateGeometry().
ExcuteInEditorUpdates the geometry of light in editor mode.

Events

Check the ‘Send Event Message’ property. Create the ‘OnEnterLight (Light2DBase)’ m ‘OnExitLight (Light2DBase)’ method on the object object.