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); }
private void Start() { _nodes = FindObjectsOfType<Node>(); finder = new PathBuilderFinder (_nodes, maxNodeDistance); BuildConnections(); finder.SetConnections (_connections); }