Adding Button in component header

Hi guys, I’m very interested in making simple tools that will help user. But I don’t know much about Editor coding. Btw,


I want to add here buttons. How can I do this?

You can add a menu item to the burger menu (three vertical dots button). I don’t think you can add anything to the toolbar itself through a public API.

There seems to be a github package that solves it, here.

The screenshots looks like what you want:

Although from the example code, it looks like you have to hand-craft pixel offsets for the button positions. So that that is uh, pretty gnarly, but it seems like it should work. I haven’t tested it, so good luck.

1 Like

Ugh. :face_with_spiral_eyes:

For one’s own use this is okay but one shouldn’t create a public tool with that. Any time in the future Unity may add a new button besides the Presets (sliders) and Help (question) and then any custom buttons were to overlap. Just a heads up in case this is meant for a public asset. :wink:

But good to know that such a thing can be done!

Its the best that can be done when there’s no public API to hook into this.

Its kinda wild that even in Unity 6 the component header is still drawn with IMGUI. C’mon Unity, update it to UI Toolkit and give us a way to hook into the buttons being created.