using UnityEngine; using System.Collections.Generic; namespace UnityEngine.ProBuilder.MeshOperations { /// /// Subdivide a ProBuilder mesh. /// static class Subdivision { /// /// Subdivide all faces on the mesh. /// /// More accurately, this inserts a vertex at the center of each face and connects each edge at it's center. /// /// public static ActionResult Subdivide(this ProBuilderMesh pb) { return pb.Subdivide(pb.facesInternal) != null ? new ActionResult(ActionResult.Status.Success, "Subdivide") : new ActionResult(ActionResult.Status.Failure, "Subdivide Failed"); } /// /// Subdivide a mesh, optionally restricting to the specified faces. /// /// /// The faces to be affected by subdivision. /// The faces created as a result of the subdivision. public static Face[] Subdivide(this ProBuilderMesh pb, IList faces) { return ConnectElements.Connect(pb, faces); } } }