gasgiant / Markup-Attributes

A Unity Editor extension for customizing inspector layout with attributes.
MIT License
289 stars 11 forks source link

Match material property size with Unity's defaults #11

Open forestrf opened 2 years ago

forestrf commented 2 years ago

I wanted the material gui to render the labels, controls and everything the same way the default one does. Searching around with ILSpy to see how they do it I found that, fortunately, it was done with a single line.

This is how it looks before and after the change:

Before After
1657254525 2253 1657254470 2252
forestrf commented 2 years ago

I added another commit to add more default stuff from Unity:

if (UnityEngine.Rendering.SupportedRenderingFeatures.active.editableMaterialRenderQueue) {
    materialEditor.RenderQueueField();
}
materialEditor.EnableInstancingField();
materialEditor.DoubleSidedGIField();

imagen