internal void EditMesh(Occluder occluder)
        {
            EditorGUI.BeginChangeCheck();

            occluder.DebugRender();

            var pos   = occluder.LocalPosition;
            var rot   = occluder.LocalRotation;
            var scale = occluder.LocalScale;

            Handles.TransformHandle(ref pos, ref rot, ref scale);
            if (EditorGUI.EndChangeCheck())
            {
                Undo.RecordObject(occluder, "Modify occluder transform");
                PrefabUtility.RecordPrefabInstancePropertyModifications(occluder);

                occluder.LocalPosition = pos;
                occluder.LocalRotation = rot;
                occluder.LocalScale    = scale;
            }
        }
        internal void EditVolume(Occluder occluder)
        {
            if (occluder.Mesh == null)
            {
                return;
            }

            var ctx = occluder.Context;

            ctx.ComputeEdges();
            ctx.ComputeNormals();

            if (ctx.Dragging <= 0)
            {
                //ctx.ComputeFaces();
            }
            else
            {
                ctx.UpdateFaces();
            }

            int currentFaceId = ctx.Dragging;

            ctx.Dragging = -1;
            occluder.DebugRender();

            var mesh = occluder.Mesh;

            var verts   = mesh.vertices;
            var inverse = occluder.localTransform.inverse;

            // Render the back faces first, so that the hidden edges appear behind the handles
            RenderWireframe(ctx, occluder, mesh, verts, false);

            EditorGUI.BeginChangeCheck();

            var transform = occluder.localTransform;

            if (m_editMode == EditMode.Vertex)
            {
                EditVertices(ctx, mesh, verts, inverse, transform);
            }

            if (m_editMode == EditMode.Face)
            {
                EditFaces(ctx, currentFaceId, verts, inverse, transform);
            }

            // Render the front faces
            RenderWireframe(ctx, occluder, mesh, verts, true);

            if (EditorGUI.EndChangeCheck())
            {
                Undo.RegisterCompleteObjectUndo(occluder.Mesh, "Edit occluder volume");
                //            Undo.RecordObject(occluder.Mesh, "Edit occluder vertices");

                occluder.Mesh.SetVertices(verts);
                occluder.Mesh.RecalculateNormals();
                occluder.Mesh.RecalculateBounds();
                occluder.Mesh.MarkModified();

                PrefabUtility.RecordPrefabInstancePropertyModifications(occluder.Mesh);
            }

            if (m_editMode == EditMode.Mesh)
            {
                EditorGUI.BeginChangeCheck();
                var pos   = occluder.LocalPosition;
                var rot   = occluder.LocalRotation;
                var scale = occluder.LocalScale;

                Handles.TransformHandle(ref pos, ref rot, ref scale);

                if (EditorGUI.EndChangeCheck())
                {
                    Undo.RecordObject(occluder, "Modify occluder transform");

                    occluder.LocalPosition = pos;
                    occluder.LocalRotation = rot;
                    occluder.LocalScale    = scale;

                    PrefabUtility.RecordPrefabInstancePropertyModifications(occluder);
                }
            }
        }