private void OnExpandSelection(object sender, EventArgs e) { IMeshEditor meshEditor = m_proBuilderTool.GetEditor(); MeshSelection selection = meshEditor.GetSelection(); MeshEditorState oldState = meshEditor.GetState(false); selection = PBSmoothing.ExpandSelection(selection); if (m_proBuilderTool.Mode == ProBuilderToolMode.Vertex) { selection = selection.ToVertices(false); } else if (m_proBuilderTool.Mode == ProBuilderToolMode.Edge) { selection = selection.ToEdges(false); } meshEditor.SetSelection(selection); m_proBuilderTool.TryUpdatePivotTransform(); MeshEditorState newState = meshEditor.GetState(false); m_proBuilderTool.RecordState(oldState, newState, true); }