像我们正常使用materials[0] = Color.red;或者 materials[1] = Color.green;都是没有效果的
这里为大家提供两种方式
1.
GetComponent<Renderer>().materials[0].CopyPropertiesFromMaterial(要更换的材质球);
GetComponent<Renderer>().materials[0].CopyPropertiesFromMaterial(Material_1);
GetComponent<Renderer>().materials[1].CopyPropertiesFromMaterial(Material_2);
2.
新建一个material[]然后直接赋给模型的materials
Material[] Mat = new Material[2] { Mat1, Mat2 };
GetComponent<Renderer>().materials = Mat;