public static void Build(GameObject gameObject, D2D_EdgeSpriteCollider.Cell colliderCell, float detail) { if (gameObject != null && colliderCell != null) { var pathCount = 0; for (var i = 0; i < cellCount; i++) { var cell = cells[i]; for (var j = 0; j < cell.PointCount; j++) { var point = cellPoints[cell.PointIndex + j]; if (point.Used == false) { TraceEdges(cell, point); WeldLines(); OptimizeEdges(detail); if (tracedEdges.Count >= 2) { CompileTracedEdges(gameObject, colliderCell, pathCount); pathCount += 1; } } } } colliderCell.Trim(pathCount); } }
private static void CompileTracedEdges(GameObject gameObject, D2D_EdgeSpriteCollider.Cell colliderCell, int pathCount) { var collider = colliderCell.GetCollider(gameObject, pathCount); collider.points = ExtractTracedEdges(); }