Ejemplo n.º 1
0
        /// <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));
        }
Ejemplo n.º 2
0
        /// <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));
        }
Ejemplo n.º 3
0
        /// <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));
        }
Ejemplo n.º 4
0
        /// <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));
        }