Ejemplo n.º 1
0
        public List<Node> FindShorterPathFromTo(int fromId, int toId, PathBuilderFinder pathInfo)
        {
            reachPoint = toId;
            this.pathInfo = pathInfo;

            List<Connection> foundedConnections = pathInfo.Connections.FindAll (c => c.FromNode.Id == fromId);
            List<List<Connection>> paths = CreatePathsConnections (foundedConnections, markedConnections, true);
            shorterPath = SelectShorterPath (paths);

            return GetNodesInPath (shorterPath);
        }
Ejemplo n.º 2
0
 private void Start()
 {
     _nodes = FindObjectsOfType<Node>();
     finder = new PathBuilderFinder (_nodes, maxNodeDistance);
     BuildConnections();
     finder.SetConnections (_connections);
 }