UnityEditor.Handles.BeginGUI C# (CSharp) Method

BeginGUI() public static method

Begin a 2D GUI block inside the 3D handle GUI.

public static BeginGUI ( ) : void
return void
        public static void BeginGUI()
        {
            if ((Camera.current != null) && (Event.current.type == EventType.Repaint))
            {
                GUIClip.Reapply();
            }
        }

Same methods

Handles::BeginGUI ( Rect position ) : void

Usage Example

示例#1
0
        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();
        }
All Usage Examples Of UnityEditor.Handles::BeginGUI