Hide MaterialEditor in Inspector C#

I’m writing a custom editor and i want to know how can i hide the Material Editor in Inspector in C#.

Image example:

You can’t. The best you can do is write your own shader, and put nothing in its custom editor.

http://docs.unity3d.com/Documentation/Components/SL-CustomMaterialEditors.html

I know this is old, but I recently ran into this recently and found the solution:

gameObject.GetComponent<Renderer>().sharedMaterial.hideFlags = HideFlags.HideInInspector;

Note that the material inspector will still show up if the Renderer is hidden, so you can’t just iterate through the .GetComponent() array - you have to hide this one explicitly.

I hope that helps someone!