static void DoContextualToolbarOverlay(UnityEngine.Object target, SceneView sceneView)
        {
            GUILayout.BeginHorizontal(GUIStyle.none, GUILayout.MinWidth(210), GUILayout.Height(30));

            EditorToolContext.GetCustomEditorTools(s_EditorToolModes, false);

            if (s_EditorToolModes.Count > 0)
            {
                EditorGUI.BeginChangeCheck();

                EditorGUILayout.EditorToolbar(s_EditorToolModes);

                if (EditorGUI.EndChangeCheck())
                {
                    foreach (var inspector in InspectorWindow.GetInspectors())
                    {
                        foreach (var editor in inspector.tracker.activeEditors)
                        {
                            editor.Repaint();
                        }
                    }
                }
            }
            else
            {
                var fontStyle = EditorStyles.label.fontStyle;
                EditorStyles.label.fontStyle = FontStyle.Italic;
                GUILayout.Label(Styles.noToolsAvailable, EditorStyles.centeredGreyMiniLabel);
                EditorStyles.label.fontStyle = fontStyle;
            }
            GUILayout.EndHorizontal();
        }
        internal static void DoToolContextMenu()
        {
            var toolHistoryMenu = new GenericMenu()
            {
                allowDuplicateNames = true
            };

            var foundTool = false;

            // Recent history
            if (EditorToolContext.GetLastCustomTool() != null)
            {
                foundTool = true;
                toolHistoryMenu.AddDisabledItem(Styles.recentTools);
                EditorToolContext.GetToolHistory(s_ToolList, true);

                for (var i = 0; i < Math.Min(k_MaxToolHistory, s_ToolList.Count); i++)
                {
                    var tool = s_ToolList[i];

                    if (EditorToolUtility.IsCustomEditorTool(tool.GetType()))
                    {
                        continue;
                    }

                    var name = EditorToolUtility.GetToolName(tool.GetType());

                    if (tool.IsAvailable())
                    {
                        toolHistoryMenu.AddItem(new GUIContent(name), false, () => { EditorToolContext.activeTool = tool; });
                    }
                    else
                    {
                        toolHistoryMenu.AddDisabledItem(new GUIContent(name));
                    }
                }

                toolHistoryMenu.AddSeparator("");
            }

            EditorToolContext.GetCustomEditorTools(s_ToolList, false);

            // Current selection
            if (s_ToolList.Any())
            {
                foundTool = true;
                toolHistoryMenu.AddDisabledItem(Styles.selectionTools);

                for (var i = 0; i < s_ToolList.Count; i++)
                {
                    var tool = s_ToolList[i];

                    if (!EditorToolUtility.IsCustomEditorTool(tool.GetType()))
                    {
                        continue;
                    }

                    var path = new GUIContent(EditorToolUtility.GetToolMenuPath(tool));

                    if (tool.IsAvailable())
                    {
                        toolHistoryMenu.AddItem(path, false, () => { EditorToolContext.activeTool = tool; });
                    }
                    else
                    {
                        toolHistoryMenu.AddDisabledItem(path);
                    }
                }

                toolHistoryMenu.AddSeparator("");
            }

            var global = EditorToolUtility.GetCustomEditorToolsForType(null);

            if (global.Any())
            {
                foundTool = true;
                toolHistoryMenu.AddDisabledItem(Styles.availableTools);

                foreach (var toolType in global)
                {
                    toolHistoryMenu.AddItem(
                        new GUIContent(EditorToolUtility.GetToolMenuPath(toolType)),
                        false,
                        () => { EditorTools.EditorTools.SetActiveTool(toolType); });
                }
            }

            if (!foundTool)
            {
                toolHistoryMenu.AddDisabledItem(Styles.noToolsAvailable);
            }

            toolHistoryMenu.ShowAsContext();
        }