protected void BeginEdit(string undoMessage)
        {
            if (m_IsEditing)
            {
                return;
            }

            // Disable iterative lightmapping
            Lightmapping.PushGIWorkflowMode();

            var selection = MeshSelection.topInternal.ToArray();

            UndoUtility.RegisterCompleteObjectUndo(selection, string.IsNullOrEmpty(undoMessage) ? "Modify Vertices" : undoMessage);

            if (beforeMeshModification != null)
            {
                beforeMeshModification(selection);
            }

            if (currentEvent.shift)
            {
                Extrude();
            }

            m_IsEditing = true;

            m_WorldSnapEnabled   = ProBuilderSnapSettings.snapMode == SnapMode.World;
            m_SnapAxisConstraint = ProBuilderSnapSettings.snapMethod == SnapAxis.ActiveAxis; ProGridsInterface.UseAxisConstraints();
            m_MoveSnapValue      = m_WorldSnapEnabled ? ProBuilderSnapSettings.worldSnapMoveValue : ProBuilderSnapSettings.incrementalSnapMoveValue;

            foreach (var mesh in selection)
            {
                mesh.ToMesh();
                mesh.Refresh();
            }

            OnToolEngaged();
        }
Esempio n. 2
0
        protected void BeginEdit(string undoMessage)
        {
            if (m_IsEditing)
            {
                return;
            }

            // Disable iterative lightmapping
            Lightmapping.PushGIWorkflowMode();

            var selection = MeshSelection.topInternal.ToArray();

            UndoUtility.RegisterCompleteObjectUndo(selection, string.IsNullOrEmpty(undoMessage) ? "Modify Vertices" : undoMessage);

            if (beforeMeshModification != null)
            {
                beforeMeshModification(selection);
            }

            if (currentEvent.shift)
            {
                Extrude();
            }

            m_IsEditing = true;

            m_SnapAxisConstraint = EditorSnapping.snapMethod == SnapAxis.ActiveAxis;

            foreach (var mesh in selection)
            {
                mesh.ToMesh();
                mesh.Refresh();
            }

            OnToolEngaged();
        }
 void OnBeginVertexModification()
 {
     m_IsMoving = true;
     UndoUtility.RecordObject(m_Target, "Modify Bezier Spline");
     Lightmapping.PushGIWorkflowMode();
 }