Table of Contents

Unity Editor Main Toolbar

Editor/Uncategorized/UnityEditorMainToolbar.cs   HeaderDoc

(c) 2024 Sator Imaging, Licensed under the MIT License https://github.com/sator-imaging/Unity-Fundamentals

How to Use

// add item to left/right area of main toolbar
UnityEditorMainToolbar.Left.Add(new Label("Left"));
UnityEditorMainToolbar.Right.Add(new Label("Right"));

// add item to center area using legacy GUILayout functions
UnityEditorMainToolbar.Center.Add(new IMGUIContainer(() =>  // or .Insert(0, ...)
{
    if (GUILayout.Button("IMGUI Button",
                         EditorStyles.toolbarButton))  // match look with builtin buttons
    {
        EditorUtility.DisplayDialog("DEBUG", "IMGUI Works!!", "Close");
    }
}));