| Parameter | Description |
|---|---|
| filter | An initial search filter for the picker. Pass an empty string or null for no filter. |
Opens the Main Toolbar picker, pre-filtered to a search term.
Equivalent to calling MainToolbar.OpenMainToolbarPicker with PickerMode.All. The Main Toolbar picker stays open after each pick, so you can toggle several elements or menu item shortcuts in a row.
| Parameter | Description |
|---|---|
| mode | Which tab the picker opens to. Refer to MainToolbar.PickerMode. Defaults to All. |
| filter | An initial search filter for the picker. Pass an empty string or null for no filter. |
Opens the Main Toolbar picker. The Main Toolbar picker is a search window you can use to find and toggle toolbar elements and menu items.
The Main Toolbar picker stays open after each pick, so you can toggle several elements or menu item shortcuts in a row. Use MainToolbar.PickerMode to open directly on toolbar elements or menu items only, or leave it at the default to show everything together.
using UnityEditor; using UnityEditor.Toolbars; public class MainToolbarPickerExample { // Opens the picker filtered to just this package's own toolbar elements, so users // can find and pin them without wading through everything else in the picker. [MenuItem("Examples/Open My Package's Toolbar Elements")] static void OpenPickerForMyPackage() { MainToolbar.OpenMainToolbarPicker(MainToolbar.PickerMode.ToolbarElements, "My Package Name"); } }