internal void RebuildShape() { RecalculateBounds(); if (m_Bounds.size.sqrMagnitude < .01f || Mathf.Abs(m_Bounds.extents.x) < 0.001f || Mathf.Abs(m_Bounds.extents.z) < 0.001f) { if (m_ShapeComponent.mesh.vertexCount > 0) { m_ShapeComponent.mesh.Clear(); m_ShapeComponent.mesh.Rebuild(); ProBuilderEditor.Refresh(true); } return; } if (!m_IsShapeInit) { EditorShapeUtility.CopyLastParams(m_ShapeComponent.shape, m_ShapeComponent.shape.GetType()); m_ShapeComponent.gameObject.hideFlags = HideFlags.None; UndoUtility.RegisterCreatedObjectUndo(m_ShapeComponent.gameObject, "Draw Shape"); } m_ShapeComponent.Rebuild(m_Bounds, m_PlaneRotation); ProBuilderEditor.Refresh(false); if (!m_IsShapeInit) { EditorUtility.InitObject(m_ShapeComponent.mesh); m_IsShapeInit = true; } SceneView.RepaintAll(); }