how to assign an object a shader through code in c# code example
Example: c# change material in code
currentObject.GetComponent<Renderer>().material = materialToAssign;
currentObject.GetComponent<Renderer>().material = materialToAssign;