/// <summary> /// Return a list of path nodes from the start tile to the end tile ( Use RpgMapHelper class to get the tile index ) /// </summary> /// <param name="startIdx"></param> /// <param name="endIdx"></param> /// <returns></returns> public IEnumerator GetRouteFromToAsync(Vector2 startPos, Vector2 endPos) { IPathNode start = GetMapTileNode(startPos); EndNode = GetMapTileNode(endPos); return(m_pathFinding.ComputePathAsync(start, EndNode, AllowBlockedDestination)); }
/// <summary> /// Return a list of path nodes from the start tile to the end tile /// </summary> /// <param name="startIdx"></param> /// <param name="endIdx"></param> /// <returns></returns> public IEnumerator GetRouteFromToAsync(Vector2 startPos, Vector2 endPos) { IPathNode start = GetMapTileNode(startPos); EndNode = GetMapTileNode(endPos); return(m_pathFinding.ComputePathAsync(start, EndNode, MaxDistance > 0? MaxDistance : int.MaxValue)); }
/// <summary> /// Return a list of path nodes from the start tile to the end tile ( Use RpgMapHelper class to get the tile index ) /// </summary> /// <param name="startIdx"></param> /// <param name="endIdx"></param> /// <returns></returns> public IEnumerator GetRouteFromToAsync(int startIdx, int endIdx) { IPathNode start = GetMapTileNode(startIdx); EndNode = GetMapTileNode(endIdx); return(m_pathFinding.ComputePathAsync(start, EndNode)); }
/// <summary> /// Return a list of path nodes from the start tile to the end tile ( Use RpgMapHelper class to get the tile index ) /// </summary> /// <param name="startIdx"></param> /// <param name="endIdx"></param> /// <returns></returns> public IEnumerator GetRouteFromToAsync(Vector2 startPos, Vector2 endPos) { ClearNodeDictionary(); IPathNode start = GetMapTileNode(startPos); EndNode = GetMapTileNode(endPos); return(m_pathFinding.ComputePathAsync(start, EndNode)); }