Adding a button to the toolbar menu
Asked Answered
S

2

0

I was wondering if it was possible to add a button or a dropdown to the Unity toolbar (where the account dropdown, unity services, play buttons, layers dropdown, …).
Found this but can’t find how to work around with
UnityCsReference/Modules/EditorToolbar/ToolbarElements/AccountDropdown.cs at master · Unity-Technologies/UnityCsReference · GitHub
If someone knows about this topic, I would appreciate you sharing your knowledge.
Than you

Sobel answered 18/6, 2023 at 10:50 Comment(0)
S
0

It’s unclear what you mean by Unity toolbar. MenuItem exists so you can add to the main menu and component context menus. If you want to add to the scene view toolbars you should make an Overlay.

Suzerainty answered 17/4, 2024 at 19:8 Comment(3)

This is what I looking for! Thanks

Pilotage

I know about those, but I was talking about where the play buttons, layers, and unity services. Sorry for the misunderstanding.

Sobel

The only way to modify that area is via reflection

Suzerainty
F
0

This is not officially supported by unity yet. Maybe at some point there will be public access to the ModeService so we can define our own Modes similar to the safemode that you can enter when you open a project with compile errors. I’ve tried accessing this feature via reflection and while it’s possible i don’t think it’s ready to use for anything meaningful you want people to interact with.

If you only want to extend the “normal” editor toolbar that’s displaying in every editor layout you can achieve it via reflection. I haven’t tested it but this repo does exactly that.

Flair answered 19/6, 2023 at 9:18 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.