コード例 #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));
        }
コード例 #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));
        }
コード例 #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));
        }
コード例 #4
0
ファイル: MapPathFinding.cs プロジェクト: FrankOrtiz/ProtoRun
        /// <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));
        }