Example #1
0
 private void CreateMultiLine(int[][] arcsSet, TopoJson topo)
 {
     foreach (var arcs in arcsSet)
     {
         CreateLine(arcs, topo);
     }
 }
Example #2
0
        public static TopoJson Parse(string jsonText)
        {
            var      json     = (IDictionary)Json.Deserialize(jsonText);
            TopoJson topoJson = new TopoJson().Parse(json);

            return(topoJson);
        }
Example #3
0
        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);
        }
Example #4
0
 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());
 }