예제 #1
0
        public static void BuildEdge(D2dEdgeColliderCell cell, Stack <EdgeCollider2D> 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 path from point
                if (point.Used == false)
                {
                    Trace(point);
                    WeldLines(weld);
                    OptimizeEdges(detail);

                    cell.AddPath(tempColliders, child, ExtractPoints(0));
                }
            }
        }
        public static void BuildEdge(D2dEdgeColliderCell cell, List <EdgeCollider2D> 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.AddPath(unusedColliders, child, ExtractPoints(0));
                }
            }
        }