Exemplo n.º 1
0
    /// <summary>
    /// Creates a pathfinding instance and generates a range map for you.
    /// </summary>
    /// <param name="start">Start tile</param>
    /// <param name="range">Range of tiles</param>
    /// <returns></returns>
    public static Pathfinding GetRange(Tile start, int range, bool ignoreBlock = false)
    {
        Pathfinding newPath = new Pathfinding();

        newPath.CreateRangedMap(start, range, ignoreBlock);
        return(newPath);
    }
Exemplo n.º 2
0
 void GetMovementTiles()
 {
     if (rPathfinding == null)
     {
         rPathfinding = Pathfinding.GetRange(tile, data.movementRange - movementUsed);
     }
     else
     {
         rPathfinding.CreateRangedMap(tile, data.movementRange - movementUsed);
     }
     moveRangeTiles = new Tile[rPathfinding.path.Count];
     for (int i = 0; i < rPathfinding.path.Count; i++)
     {
         moveRangeTiles[i] = GameManager.instance.GetTile(rPathfinding.path[i]);
     }
     //GetAttackTiles(tile);
 }