internal static void OnSceneGUI(SceneView sceneView)
{
if (e.type == EventType.KeyDown &&
e.modifiers == EventModifiers.None &&
e.keyCode == KeyCode.B)
{
PeekPlugin.Configuration.displaySceneToolbars = !PeekPlugin.Configuration.displaySceneToolbars;
PeekPlugin.Configuration.Save();
e.Use();
}
if (!PeekPlugin.Configuration.enableSceneToolbars.Display(sceneView.maximized) ||
!PeekPlugin.Configuration.displaySceneToolbars)
{
return;
}
Profiler.BeginSample("Peek." + nameof(SceneToolbars));
try
{
Handles.BeginGUI();
DrawToolbar(sceneView, selectionToolbarControl, selectionToolbarTargets);
if (PeekPlugin.Configuration.enableStickyDragAndDrop)
{
if (dragToolbarControl != null)
{
EditorGUI.BeginDisabledGroup(!dragToolbarLocked);
DrawToolbar(sceneView, dragToolbarControl, new[] { dragToolbarTarget });
EditorGUI.EndDisabledGroup();
}
RefreshDragToolbar(sceneView);
}
if (PeekPlugin.Configuration.enableHierarchySpaceShortcut &&
e.type == EventType.KeyDown &&
e.modifiers == EventModifiers.None &&
e.keyCode == KeyCode.Space)
{
if (OpenHierarchyTool())
{
e.Use();
}
}
Handles.EndGUI();
}
catch (Exception ex)
{
Debug.LogException(ex);
}
Profiler.EndSample();
}