private void CreateLine(int[] arcs, TopoJson topo) { Vector2[] points = arcs .Select(arcIndex => topo.DecodeArc(topo.arcs[arcIndex]).ToArray()) .Flatten() .ToArray(); var obj = TopoLine.CreateLine(this.Prefab, this.gameObject.transform, points, 0.01f); this.ApplyMaterial(obj, this.RoadMaterial); }
public static Vector2[] CreateVerts(int[] arcIndexes, TopoJson topo) { return(arcIndexes .Select(arcIndex => { int index = (arcIndex >= 0) ? arcIndex : BitwiseNot(arcIndex); double[][] arc = topo.arcs[index]; var points = topo.DecodeArc(arc); points = (arcIndex >= 0) ? points : points.Reverse(); points = points.Drop(1); return points.ToArray(); }) .Flatten() .ToArray()); }