Set Light2D sprite via scripting


I would like to create an empty object and add to it a Light2D component with a specified Sprite, however, I can’t seem to figure out how to change the sprite of the component via script.


Underlined is the property I would like to change via C#

Try this: Light2D.sprite = yourSprite |OR| Light2D.texture = yourSprite