Basically you just need to access the material property of the Renderer component.
public Material yourMaterial; gameobject.GetComponent<Renderer> ().material = yourMaterial;
Basically you just need to access the material property of the Renderer component.
public Material yourMaterial; gameobject.GetComponent<Renderer> ().material = yourMaterial;