public static void InstantiateNewObjects(CuttingInfo info, List <DMesh3> subMeshes) { if (info.data.Multipiece || subMeshes.Count <= 1) { foreach (var subMesh in subMeshes) { subMesh.EnableTriangleGroups(info.data.ColorNum); var newObj = StaticFunctions.SpawnNewObject(subMesh); newObj.GetComponent <Generate>().cuttingInfo = info; } } else { var totalNewMesh = MeshEditor.Combine(subMeshes.ToArray()); totalNewMesh.EnableTriangleGroups(info.data.ColorNum); var newObj = StaticFunctions.SpawnNewObject(totalNewMesh); newObj.GetComponent <Generate>().cuttingInfo = info; //todo we need to fix PointToPoint for Point algo if we combine } }