Hiding Material Inspector?

Hi,

is there a way to prevent the MaterialInspector from showing up for a certain GameObject? I wrote some classes managing the material which should kinda replace the builtin inspector for components in which they are used. That is because all changes made in the material inspector could either screw up the internal assuptions or be invalidated on next update/startup…
After all, these managers will also be used by people not so familiar with Unity and they might be tempted to also use this MaterialInspector, whcih they shouldn’t but you know what happens if you tell somebody not to do something ;)…

thanks
chris

If you are refering to the materials component of any gameobject in the inspector, you can’t hide them.

Sorry for replying to this old thread… but in case somebody needs this…
If I’m not wrong about what you asked…

gameObject.renderer.sharedMaterial.hideFlags = HideFlags.HideInInspector;

3 Likes

Bloody Swamp, this is fantastic! Just what I needed!