How to Assign Sprite-Lit-Default material in C#

I have a full screen sprite. Before I was dealing with 2D lights, when I needed to change the Sprite, I simply changed it with something like this:

this.gameObject.GetComponent().sprite = L2B1;

Now that I’m using 2D lights, the new sprites seem to be coming in with Sprite-Default as their material. But with the onscreen lights, I need the sprite to retain Sprite-Lit-Default material. I know that a simple line of code like the following, will allow me to assign a material:

this.gameObject.GetComponent().material = newMaterialRef;

What I don’t know is how to assign the already existing material of sprite-lit-default to newMaterialRef.


Actually, I may have just figured it out. By simply making newMaterialRef public, I can plug in the appropriate material in Unity itself.

Unfortunately, this doesn’t seem to have helped my situation - though the lights are having effect in the Scene Window, they’re not in the Game Window…