The default color now is mixed of colors with the default material :
I want that at runtime or before running the game if i set the mode to None set the whole linerenderer in red color :
I tried this but this coloring the linerenderer in white even if i set the color property to red :
IEnumerator SelectAnimation(AnimationType animType)
{
switch (animType)
{
case AnimationType.SingleColorMorph:
yield return RandomSingleColorMorphing(myLineRenderer, morphTime);
break;
case AnimationType.MultiColorMorph:
yield return RandomMultiColorMorphing(myLineRenderer, morphTime);
break;
case AnimationType.Shuffle:
yield return ShuffleGradient(myLineRenderer, .5f);
break;
case AnimationType.Shift:
yield return AnimateLoop(myLineRenderer);
break;
default:
yield return ggg(Color.red);
break;
}
}
private Color ggg(Color color)
{
Material whiteDiffuseMat = new Material(Shader.Find("Unlit/Texture"));
whiteDiffuseMat.color = Color.red;
myLineRenderer.material = whiteDiffuseMat;
return color;
}
I also tried inside the method ggg to set myLineRenderer startcolor and endcolor to red without changing the material but it didn't change anything.


