unity set material color code example
Example: unity set material color
//Gets the renderer material and sets color
object.GetComponent().material.color = newColor;
//Gets the renderer material and sets color
object.GetComponent().material.color = newColor;