Exemplo n.º 1
0
 void SetCollider(ColliderImageFrame item)
 {
     Debug.Log(item);
     TheCollider.pathCount = item.cache_points.Length;
     for (int i = 0; i < item.cache_points.Length; i++)
     {
         TheCollider.SetPath(i, item.cache_points[i]);
     }
 }
Exemplo n.º 2
0
 public static void Gen(ColliderImageFrame item)
 {
     if (item.points != null)
     {
         if (!cache.TryGetValue(item.StrUid, out var cache_points))
         {
             var raw_points = new List <List <Vector2> >();
             foreach (var point in item.points)
             {
                 while (point.x >= raw_points.Count)
                 {
                     raw_points.Add(new List <Vector2>());
                 }
                 var pl = raw_points[(int)point.x];
                 pl.Add(new Vector2(point.y, point.z));
             }
             cache_points = raw_points.Select(a => a.ToArray()).ToArray();
             cache.Add(item.StrUid, cache_points);
         }
         item.cache_points = cache_points;
     }
 }