Material Leak in Editor
当我试图改变材质时,报错:Instantiating material due to calling renderer.material during edit mode. This will leak materials into the scene. You most likely want to use renderer.sharedMaterial instead.提示有泄漏
var tempMaterial = new Material(renderer.sharedMaterial);
tempMaterial.color = Color.red;
renderer.sharedMaterial = tempMaterial;
如提示修改为sharedMaterial可在editor模式下避免报错
页:
[1]