Ejemplo n.º 1
0
 public static void AutoGenerateLinks(BasePath path)
 {
     path.AddChildren();
     foreach (BasePathNode node in path.nodes)
     {
         if (node.linked == null)
         {
             node.linked = new List <BasePathNode>();
         }
         else
         {
             node.linked.Clear();
         }
         foreach (BasePathNode node2 in path.nodes)
         {
             if (!(node == node2) && GamePhysics.LineOfSight(node.transform.position, node2.transform.position, 429990145) && GamePhysics.LineOfSight(node2.transform.position, node.transform.position, 429990145))
             {
                 node.linked.Add(node2);
             }
         }
     }
 }