Error:Instantiating material due
2021-12-10 本文已影响0人
RichMartin
Error: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;
This gives no errors in edit mode.