public static void BuildPoly(D2dPolygonColliderCell cell, Stack <PolygonCollider2D> tempColliders, GameObject child, float weld, float detail) { // Find the start points of paths for (var i = 0; i < pointCount; i++) { var point = points[i]; // Build polygon from point if (point.Used == false) { Trace(point); WeldLines(weld); OptimizeEdges(detail); cell.AddPolygon(tempColliders, child, ExtractPoints(1)); } } }
public static void BuildPoly(D2dPolygonColliderCell cell, List <PolygonCollider2D> unusedColliders, GameObject child, float detail) { cell.Clear(unusedColliders); // Find the start points of paths for (var i = 0; i < pointCount; i++) { var point = points[i]; if (point.Used == false) { Trace(point); WeldLines(); OptimizeEdges(detail); cell.AddPolygon(unusedColliders, child, ExtractPoints(1)); } } // Remove unused polygons cell.Trim(); }