How to avoid turning materials into instances while looking at them?

I don’t know what I did, but for some reason just looking at a material’s properties turns it into an instance.

I’m not trying to change the material. I just want to compare and see if it matches my other material whether it be just by name or some other property. In my mind, it should have no reason to change into an instance just because I’m reading it’s name. I don’t want to see my drawcalls go up.

Here’s my code in c#… Everything I do seems to turn it into an instance whether it’s an if question or print function. This is silly. I don’t know what I’m doing wrong.

foreach (MeshRenderer mr in mshRnd)
            Material mm = mr.material;

If I remove this code, none of my materials are changed into instances.

Using the ‘material’ property of any Renderer component will create a new instance. What you want to use instead is ‘sharedMaterial’.