static void OnDuringSceneGUI(SceneView sceneView)
        {
            Profiler.BeginSample("OnDuringSceneGUI");
            // Workaround where Unity stops redrawing sceneview after a second, which makes hovering over edge visualization stop working
            if (Event.current.type == EventType.MouseMove)
            {
                sceneView.Repaint();
            }

            var prevSkin = GUI.skin;

            GUI.skin = ChiselSceneGUIStyle.GetSceneSkin();
            try
            {
                ChiselSceneGUIStyle.Update();
                ChiselGridSettings.GridOnSceneGUI(sceneView);
                ChiselOutlineRenderer.Instance.OnSceneGUI(sceneView);

                if (EditorWindow.mouseOverWindow == sceneView || // This helps prevent weird issues with overlapping sceneviews + avoid some performance issues with multiple sceneviews open
                    (Event.current.type != EventType.MouseMove && Event.current.type != EventType.Layout))
                {
                    ChiselDragAndDropManager.Instance.OnSceneGUI(sceneView);
                    ChiselClickSelectionManager.Instance.OnSceneGUI(sceneView);
                }
            }
            finally
            {
                GUI.skin = prevSkin;
            }
            Profiler.EndSample();
        }
Esempio n. 2
0
        static void OnBeforeSceneGUI(SceneView sceneView)
        {
            var prevSkin = GUI.skin;

            GUI.skin = ChiselSceneGUIStyle.GetSceneSkin();
            try
            {
                ChiselSceneGUIStyle.Update();
                ChiselSceneBottomGUI.OnSceneGUI(sceneView);
            }
            finally
            {
                GUI.skin = prevSkin;
            }
        }
Esempio n. 3
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;
            }
        }