I have a material that I am using to add a glowing effect to my line renderer. I can add this as a 2nd material to the line to give it a glowing effect.
I want to be able to add/remove this material through code, so I can essentially enable/disable the effect. I have no clue how to access the current materials of the line renderer in a way that allows me to add/remove elements from the materials array.
Pseudocode:
private void SetGlow()
{
line.materials.Length = 2;
line.materials[1] = "/new/material/directory/material.mat";
}
I'm open to suggestions.
Thanks!