static void OnSceneGUI(SceneView sceneView)
        {
            GridOnSceneGUI(sceneView);
            ChiselOutlineRenderer.Instance.OnSceneGUI(sceneView);
            var dragArea = ChiselSceneBottomGUI.OnSceneGUI(sceneView);

            ChiselEditModeGUI.OnSceneGUI(sceneView, dragArea);

            ChiselDragAndDropManager.Instance.OnSceneGUI(sceneView);
            ChiselClickSelectionManager.Instance.OnSceneGUI(sceneView);
        }
示例#2
0
        static void OnSceneGUI(SceneView sceneView)
        {
            var dragArea = ChiselGUIUtility.GetRectForEditorWindow(sceneView);

            GridOnSceneGUI(sceneView);
            ChiselEditModeGUI.OnSceneGUI(sceneView, dragArea);
            ChiselOutlineRenderer.Instance.OnSceneGUI(sceneView);
            ChiselSceneBottomGUI.OnSceneGUI(sceneView);

            ChiselDragAndDropManager.Instance.OnSceneGUI(sceneView);
            ChiselClickSelectionManager.Instance.OnSceneGUI(sceneView);
        }
        public virtual void     OnSceneGUI(SceneView sceneView, Rect dragArea)
        {
            var evt = Event.current;

            switch (evt.type)
            {
            case EventType.KeyDown:
            case EventType.ValidateCommand:
            {
                if (Tools.current == Tool.View ||
                    Tools.current == Tool.None ||
                    (evt.modifiers & (EventModifiers.Shift | EventModifiers.Control | EventModifiers.Alt | EventModifiers.Command)) != EventModifiers.None ||
                    GUIUtility.hotControl != 0)
                {
                    break;
                }

                if (evt.keyCode == KeyCode.Escape)
                {
                    evt.Use();
                    break;
                }
                break;
            }

            case EventType.KeyUp:
            {
                if (Tools.current == Tool.View ||
                    Tools.current == Tool.None ||
                    (evt.modifiers & (EventModifiers.Shift | EventModifiers.Control | EventModifiers.Alt | EventModifiers.Command)) != EventModifiers.None ||
                    GUIUtility.hotControl != 0)
                {
                    break;
                }

                if (evt.keyCode == KeyCode.Escape)
                {
                    evt.Use();
                    ChiselEditModeGUI.RestoreEditModeState();
                    GUIUtility.ExitGUI();
                }
                break;
            }
            }
        }
示例#4
0
        static void OnDuringSceneGUI(SceneView sceneView)
        {
            var prevSkin = GUI.skin;

            GUI.skin = ChiselSceneGUIStyle.GetSceneSkin();
            try
            {
                var dragArea = ChiselGUIUtility.GetRectForEditorWindow(sceneView);
                GridOnSceneGUI(sceneView);
                ChiselEditModeGUI.OnSceneGUI(sceneView, dragArea);
                ChiselOutlineRenderer.Instance.OnSceneGUI(sceneView);

                ChiselDragAndDropManager.Instance.OnSceneGUI(sceneView);
                ChiselClickSelectionManager.Instance.OnSceneGUI(sceneView);
            }
            finally
            {
                GUI.skin = prevSkin;
            }
        }