unity3d给某个对象添加材质
public void SetMaterial() { GameObject indexGameObject=list_topIfcSlabs[5]; Renderer[] renders = indexGameObject.GetComponentsInChildren<Renderer>(); Material newMat = Resources.Load<Material>("Material/Material_TH"); renders[0].material = newMat; }
##############################