DrawDefault for PropertyDrawers?

Hi all,
I just wanted to stick a button or two on top of a class (or on each element of a class in a list).

With an Editor script using OnInspectorGUI, I can easily add some buttons and put “DrawDefaultInspector()” at the bottom to continue drawing normally.

Is there a property drawer equivalent for this?

Thanks!

Probably just using PropertyField and supplying the serialised property the property drawer gives you.

Thanks for the reply @spiney199 .

It looks like Im not the first to run into this.

I havent gotten one of the solutions to work yet without freezing Unity.

Right, a property field would just invoke the property drawer and go infinite…

In your instance I think you want a DecoratorDrawer instead, actually, now that I remember them.

Hi. What version of Unity are you using?

Im on 2022.2.15 @oscarAbraham

I did a test manually by using CreatePropertyGUI, its actually not to difficult to use this, way simpler than OnInspectorGUI. Since I only wanted to add a button and not really change anything, I dont want to keep updating the property drawer every time I change the class.

Id like the button to call a function on the specific data of that object/instance.
@spiney199 , is this something that DecoratorDrawers can do?

Actually looking at the docs, you don’t get access to the serialised property for some reason?? So I guess not.

This is why I use Odin. Unity’s inspector tools just leave too much to be desired.