|
Unity Grid Toolkit
Utilitary API to proceed operations on abstract grids such as tile extraction, raycasting, and pathfinding.
|
Allows you to extract tiles on a grid.
Provides shape extraction (rectangles, circles, cones and lines) and neighbors extraction with a lot of parameters.
More...
Static Public Member Functions | |
| static T[] | GetTilesInARectangle< T > (T[,] grid, T center, Vector2Int rectangleExtends, bool includeCenter=true, bool includeWalls=true) |
| Get tiles in a rectangle around a center tile. Note that the order of the tiles into the returned array is not guaranteed. | |
| static T[] | GetTilesOnARectangleOutline< T > (T[,] grid, T center, Vector2Int rectangleExtends, bool includeWalls=true) |
| Get tiles on a rectangle outline around a tile. Note that the order of the tiles into the returned array is not guaranteed. | |
| static T[] | GetTilesInACircle< T > (T[,] grid, T center, int radius, bool includeCenter=true, bool includeWalls=true) |
| Get tiles in a circle around a tile. Note that the order of the tiles into the returned array is not guaranteed. | |
| static T[] | GetTilesOnACircleOutline< T > (T[,] grid, T center, int radius, bool includeWalls=true) |
| Get tiles on a circle outline around a tile. Note that the order of the tiles into the returned array is not guaranteed. | |
| static T[] | GetTilesInACone< T > (T[,] grid, T start, T destinationTile, float openingAngle, bool includeStart=true, bool includeWalls=true) |
| Get tiles in a cone starting from a tile. Note that the order of the tiles into the returned array is not guaranteed. | |
| static T[] | GetTilesInACone< T > (T[,] grid, T start, int length, float openingAngle, float directionAngle, bool includeStart=true, bool includeWalls=true) |
| Get tiles in a cone starting from a tile. Note that the order of the tiles into the returned array is not guaranteed. | |
| static T[] | GetTilesInACone< T > (T[,] grid, T start, int length, float openingAngle, Vector2 direction, bool includeStart=true, bool includeWalls=true) |
| Get tiles in a cone starting from a tile. Note that the order of the tiles into the returned array is not guaranteed. | |
| static T[] | GetTilesInACone< T > (T[,] grid, T start, Vector2Int endPosition, float openingAngle, bool includeStart=true, bool includeWalls=true) |
| Get tiles in a cone starting from a tile. Note that the order of the tiles into the returned array is not guaranteed. | |
| static T[] | GetTilesOnALine< T > (T[,] grid, T startTile, T destinationTile, bool allowDiagonals=true, bool favorVertical=false, bool includeStart=true, bool includeWalls=true) |
| Get all visible tiles from a start tile's cone of vision | |
| static T[] | GetTilesOnALine< T > (T[,] grid, T startTile, int length, float directionAngle, bool allowDiagonals=true, bool favorVertical=false, bool includeStart=true, bool includeWalls=true) |
| Get all visible tiles from a start tile's cone of vision | |
| static T[] | GetTilesOnALine< T > (T[,] grid, T startTile, int length, Vector2 direction, bool allowDiagonals=true, bool favorVertical=false, bool includeStart=true, bool includeWalls=true) |
| Get all visible tiles from a start tile's cone of vision | |
| static T[] | GetTilesOnALine< T > (T[,] grid, T startTile, Vector2Int endPosition, bool allowDiagonals=true, bool favorVertical=false, bool includeStart=true, bool includeWalls=true) |
| Get all visible tiles from a start tile's cone of vision | |
| static bool | GetTileNeighbour< T > (T[,] grid, T tile, float neighbourDirectionAngle, out T neighbour, bool includeWalls=true) |
| Get neighbour of a tile if it exists. | |
| static bool | GetTileNeighbour< T > (T[,] grid, T tile, Vector2Int neighbourDirection, out T neighbour, bool includeWalls=true) |
| Get neighbour of a tile if it exists. | |
| static T[] | GetTileNeighbours< T > (T[,] grid, T tile, bool includeWalls) |
| Get the eight neighbours of a tile when they exist. | |
| static T[] | GetTileOrthogonalsNeighbours< T > (T[,] grid, T tile, bool includeWalls) |
| Get the four orthogonals neighbours of a tile when they exist. | |
| static T[] | GetTileDiagonalsNeighbours< T > (T[,] grid, T tile, bool includeWalls) |
| Get the four diagonals neighbours of a tile when they exist. | |
| static bool | IsTileInARectangle< T > (T[,] grid, T tile, T center, Vector2Int rectangleExtends) |
| Is this tile in a rectangle or not. | |
| static bool | IsTileOnARectangleOutline< T > (T[,] grid, T tile, T center, Vector2Int rectangleExtends) |
| Is this tile on a rectangle outline or not. | |
| static bool | IsTileInACircle< T > (T[,] grid, T tile, T center, int radius) |
| Is this tile in a circle or not. | |
| static bool | IsTileOnACircleOutline< T > (T[,] grid, T tile, T center, int radius) |
| Is this tile on a circle outline or not. | |
| static bool | IsTileInACone< T > (T[,] grid, T tile, T center, T destinationTile, float openingAngle) |
| Is this tile on a cone or not. | |
| static bool | IsTileInACone< T > (T[,] grid, T tile, T center, Vector2Int endPosition, float openingAngle) |
| Is this tile on a cone or not. | |
| static bool | IsTileInACone< T > (T[,] grid, T tile, T center, int length, float openingAngle, float directionAngle) |
| Is this tile on a cone or not. | |
| static bool | IsTileInACone< T > (T[,] grid, T tile, T center, int length, float openingAngle, Vector2 direction) |
| Is this tile on a cone or not. | |
| static bool | IsTileOnALine< T > (T[,] grid, T tile, T start, T destinationTile, bool allowDiagonals=true, bool favorVertical=false) |
| Is a tile on a line. | |
| static bool | IsTileOnALine< T > (T[,] grid, T tile, T start, int length, float directionAngle, bool allowDiagonals=true, bool favorVertical=false) |
| Is a tile on a line. | |
| static bool | IsTileOnALine< T > (T[,] grid, T tile, T start, int length, Vector2 direction, bool allowDiagonals=true, bool favorVertical=false) |
| Is a tile on a line. | |
| static bool | IsTileOnALine< T > (T[,] grid, T start, T tile, Vector2Int endPosition, bool allowDiagonals=true, bool favorVertical=false) |
| Is a tile on a line. | |
| static bool | IsTileNeighbor< T > (T neighbour, T center, float neighbourDirectionAngle, bool includeWalls=true) |
| Is a tile the neighbour of another tile with the given direction. | |
| static bool | IsTileNeighbor< T > (T neighbour, T center, Vector2Int neighbourDirection, bool includeWalls=true) |
| Is a tile the neighbour of another tile with the given direction. | |
| static bool | IsTileOrthogonalNeighbor< T > (T neighbour, T center, bool includeWalls=true) |
| Is a tile an orthogonal neighbour of another tile. | |
| static bool | IsTileDiagonalNeighbor< T > (T neighbour, T center, bool includeWalls=true) |
| Is a tile an diagonal neighbour of another tile. | |
| static bool | IsTileAnyNeighbor< T > (T neighbour, T center, bool includeWalls=true) |
| Is a tile any neighbour of another tile. | |
Allows you to extract tiles on a grid.
Provides shape extraction (rectangles, circles, cones and lines) and neighbors extraction with a lot of parameters.
|
static |
Get the four diagonals neighbours of a tile when they exist.
| T | The user-defined type representing a tile (needs to implement the ITile interface) |
| grid | A two-dimensional array of tiles |
| tile | A tile |
| includeWalls | Include the non-walkable tiles into the resulting array or not. Default true |
| T | : | ITile |
|
static |
Get neighbour of a tile if it exists.
| T | The user-defined type representing a tile (needs to implement the ITile interface) |
| grid | A two-dimensional array of tiles |
| tile | A tile |
| neighbourDirectionAngle | The neighbour direction angle in degrees [0-360]. 0 represents a direction pointing to the right in 2D coordinates |
| neighbour | The neighbour of a tile |
| includeWalls | Include the non-walkable tiles into the resulting array or not. Default is true |
| T | : | ITile |
|
static |
Get neighbour of a tile if it exists.
| T | The user-defined type representing a tile (needs to implement the ITile interface) |
| grid | A two-dimensional array of tiles |
| tile | A tile |
| neighbourDirection | The direction from the tile to the desired neighbour |
| neighbour | The neighbour of a tile |
| includeWalls | Include the non-walkable tiles into the resulting array or not. Default is true |
| T | : | ITile |
|
static |
Get the eight neighbours of a tile when they exist.
| T | The user-defined type representing a tile (needs to implement the ITile interface) |
| grid | A two-dimensional array of tiles |
| tile | A tile |
| includeWalls | Include the non-walkable tiles into the resulting array or not. Default true |
| T | : | ITile |
|
static |
Get the four orthogonals neighbours of a tile when they exist.
| T | The user-defined type representing a tile (needs to implement the ITile interface) |
| grid | A two-dimensional array of tiles |
| tile | A tile |
| includeWalls | Include the non-walkable tiles into the resulting array or not. Default true |
| T | : | ITile |
|
static |
Get tiles in a circle around a tile.
Note that the order of the tiles into the returned array is not guaranteed.
| T | The user-defined type representing a tile (needs to implement the ITile interface) |
| grid | A two-dimensional array of tiles |
| center | The center tile |
| radius | The circle radius |
| includeCenter | Include the center tile into the resulting array or not. Default is true |
| includeWalls | Include the non-walkable tiles into the resulting array or not. Default true |
| T | : | ITile |
|
static |
Get tiles in a cone starting from a tile.
Note that the order of the tiles into the returned array is not guaranteed.
| T | The user-defined type representing a tile (needs to implement the ITile interface) |
| grid | A two-dimensional array of tiles |
| start | The start tile |
| length | The cone length |
| openingAngle | The cone opening angle in degrees [1-360] |
| directionAngle | The cone direction angle in degrees. 0 represents a direction pointing to the right in 2D coordinates |
| includeStart | Include the start tile into the resulting array or not. Default is true |
| includeWalls | Include the non-walkable tiles into the resulting array or not. Default is true |
| T | : | ITile |
|
static |
Get tiles in a cone starting from a tile.
Note that the order of the tiles into the returned array is not guaranteed.
| T | The user-defined type representing a tile (needs to implement the ITile interface) |
| grid | A two-dimensional array of tiles |
| start | The start tile |
| length | The cone length |
| openingAngle | The cone opening angle in degrees [1-360] |
| direction | The Vector2 representing the cone direction. Note that an 'empty' Vector2 (Vector2.zero) will be treated as Vector2.right |
| includeStart | Include the start tile into the resulting array or not. Default is true |
| includeWalls | Include the non-walkable tiles into the resulting array or not. Default is true |
| T | : | ITile |
|
static |
Get tiles in a cone starting from a tile.
Note that the order of the tiles into the returned array is not guaranteed.
| T | The user-defined type representing a tile (needs to implement the ITile interface) |
| grid | A two-dimensional array of tiles |
| start | The start tile |
| destinationTile | The destination tile |
| openingAngle | The cone opening angle in degrees [1-360] |
| includeStart | Include the start tile into the resulting array or not. Default is true |
| includeWalls | Include the non-walkable tiles into the resulting array or not. Default is true |
| T | : | ITile |
|
static |
Get tiles in a cone starting from a tile.
Note that the order of the tiles into the returned array is not guaranteed.
| T | The user-defined type representing a tile (needs to implement the ITile interface) |
| grid | A two-dimensional array of tiles |
| start | The start tile |
| endPosition | The destination virtual coordinates (do not need to be into grid range) |
| openingAngle | The cone opening angle in degrees [1-360] |
| includeStart | Include the start tile into the resulting array or not. Default is true |
| includeWalls | Include the non-walkable tiles into the resulting array or not. Default is true |
| T | : | ITile |
|
static |
Get tiles in a rectangle around a center tile.
Note that the order of the tiles into the returned array is not guaranteed.
| T | The user-defined type representing a tile (needs to implement the ITile interface) |
| grid | A two-dimensional array of tiles |
| center | The center tile |
| rectangleExtends | The Vector2Int representing the extends of the rectangle from the center |
| includeCenter | Include the center tile into the resulting array or not. Default is true |
| includeWalls | Include the non-walkable tiles into the resulting array or not. Default true |
| T | : | ITile |
|
static |
Get tiles on a circle outline around a tile.
Note that the order of the tiles into the returned array is not guaranteed.
| T | The user-defined type representing a tile (needs to implement the ITile interface) |
| grid | A two-dimensional array of tiles |
| center | The center tile |
| radius | The circle radius |
| includeWalls | Include the non-walkable tiles into the resulting array or not. Default true |
| T | : | ITile |
|
static |
Get all visible tiles from a start tile's cone of vision
| T | The user-defined type representing a tile (needs to implement the ITile interface) |
| grid | A two-dimensional array of tiles |
| startTile | The start tile |
| length | The length of the line |
| directionAngle | The angle of the line from the start tile |
| allowDiagonals | Allows the diagonals or not. Default is true |
| favorVertical | If diagonals are disabled then favor vertical when a diagonal should have been used. False will favor horizontal and is the default value. |
| includeStart | Include the start tile into the resulting array or not. Default is true |
| includeWalls | Include the non-walkable tiles into the resulting array or not. Default is true |
| T | : | ITile |
|
static |
Get all visible tiles from a start tile's cone of vision
| T | The user-defined type representing a tile (needs to implement the ITile interface) |
| grid | A two-dimensional array of tiles |
| startTile | The start tile |
| length | The length of the line |
| direction | The direction of the line from the start tile |
| allowDiagonals | Allows the diagonals or not. Default is true |
| favorVertical | If diagonals are disabled then favor vertical when a diagonal should have been used. False will favor horizontal and is the default value. |
| includeStart | Include the start tile into the resulting array or not. Default is true |
| includeWalls | Include the non-walkable tiles into the resulting array or not. Default is true |
| T | : | ITile |
|
static |
Get all visible tiles from a start tile's cone of vision
| T | The user-defined type representing a tile (needs to implement the ITile interface) |
| grid | A two-dimensional array of tiles |
| startTile | The start tile |
| destinationTile | The destination tile |
| allowDiagonals | Allows the diagonals or not. Default is true |
| favorVertical | If diagonals are disabled then favor vertical when a diagonal should have been used. False will favor horizontal and is the default value. |
| includeStart | Include the start tile into the resulting array or not. Default is true |
| includeWalls | Include the non-walkable tiles into the resulting array or not. Default is true |
| T | : | ITile |
|
static |
Get all visible tiles from a start tile's cone of vision
| T | The user-defined type representing a tile (needs to implement the ITile interface) |
| grid | A two-dimensional array of tiles |
| startTile | The start tile |
| endPosition | The destination virtual coordinates (do not need to be into grid range) |
| allowDiagonals | Allows the diagonals or not. Default is true |
| favorVertical | If diagonals are disabled then favor vertical when a diagonal should have been used. False will favor horizontal and is the default value. |
| includeStart | Include the start tile into the resulting array or not. Default is true |
| includeWalls | Include the non-walkable tiles into the resulting array or not. Default is true |
| T | : | ITile |
|
static |
Get tiles on a rectangle outline around a tile.
Note that the order of the tiles into the returned array is not guaranteed.
| T | The user-defined type representing a tile (needs to implement the ITile interface) |
| grid | A two-dimensional array of tiles |
| center | The center tile |
| rectangleExtends | The Vector2Int representing the extends of the rectangle from the center |
| includeWalls | Include the non-walkable tiles into the resulting array or not. Default true |
| T | : | ITile |
|
static |
Is a tile any neighbour of another tile.
| T | The user-defined type representing a tile (needs to implement the ITile interface) |
| neighbour | The tile to check as a neighbour |
| center | A tile |
| includeWalls | Include the non-walkable tiles into the resulting array or not. Default is true |
| T | : | ITile |
|
static |
Is a tile an diagonal neighbour of another tile.
| T | The user-defined type representing a tile (needs to implement the ITile interface) |
| neighbour | The tile to check as a neighbour |
| center | A tile |
| includeWalls | Include the non-walkable tiles into the resulting array or not. Default is true |
| T | : | ITile |
|
static |
Is this tile in a circle or not.
| T | The user-defined type representing a tile (needs to implement the ITile interface) |
| grid | A two-dimensional array of tiles |
| tile | A tile |
| center | The center tile of the rectangle |
| radius | The circle radius |
| T | : | ITile |
|
static |
Is this tile on a cone or not.
| T | The user-defined type representing a tile (needs to implement the ITile interface) |
| grid | A two-dimensional array of tiles |
| tile | A tile |
| center | The center tile of the rectangle |
| length | The length of the cone |
| openingAngle | The cone opening angle in degrees [1-360] |
| directionAngle | The cone direction angle in degrees. 0 represents a direction pointing to the right in 2D coordinates |
| T | : | ITile |
|
static |
Is this tile on a cone or not.
| T | The user-defined type representing a tile (needs to implement the ITile interface) |
| grid | A two-dimensional array of tiles |
| tile | A tile |
| center | The center tile of the rectangle |
| length | The length of the cone |
| openingAngle | The cone opening angle in degrees [1-360] |
| direction | The Vector2 representing the cone direction. Note that an 'empty' Vector2 (Vector2.zero) will be treated as Vector2.right |
| T | : | ITile |
|
static |
Is this tile on a cone or not.
| T | The user-defined type representing a tile (needs to implement the ITile interface) |
| grid | A two-dimensional array of tiles |
| tile | A tile |
| center | The center tile of the rectangle |
| destinationTile | The destination tile |
| openingAngle | The cone opening angle in degrees [1-360] |
| T | : | ITile |
|
static |
Is this tile on a cone or not.
| T | The user-defined type representing a tile (needs to implement the ITile interface) |
| grid | A two-dimensional array of tiles |
| tile | A tile |
| center | The center tile of the rectangle |
| endPosition | The destination virtual coordinates (do not need to be into grid range) |
| openingAngle | The cone opening angle in degrees [1-360] |
| T | : | ITile |
|
static |
Is this tile in a rectangle or not.
| T | The user-defined type representing a tile (needs to implement the ITile interface) |
| grid | A two-dimensional array of tiles |
| tile | A tile |
| center | The center tile of the rectangle |
| rectangleExtends | The Vector2Int representing the extends of the rectangle from the center |
| T | : | ITile |
|
static |
Is a tile the neighbour of another tile with the given direction.
| T | The user-defined type representing a tile (needs to implement the ITile interface) |
| neighbour | The tile to check as a neighbour |
| center | A tile |
| neighbourDirectionAngle | The cone direction angle in degrees [0-360]. 0 represents a direction pointing to the right in 2D coordinates |
| includeWalls | Include the non-walkable tiles into the resulting array or not. Default is true |
| T | : | ITile |
|
static |
Is a tile the neighbour of another tile with the given direction.
| T | The user-defined type representing a tile (needs to implement the ITile interface) |
| neighbour | The tile to check as a neighbour |
| center | A tile |
| neighbourDirection | The position of the expected neighbour from the tile |
| includeWalls | Include the non-walkable tiles into the resulting array or not. Default is true |
| T | : | ITile |
|
static |
Is this tile on a circle outline or not.
| T | The user-defined type representing a tile (needs to implement the ITile interface) |
| grid | A two-dimensional array of tiles |
| tile | A tile |
| center | The center tile of the rectangle |
| radius | The circle radius |
| T | : | ITile |
|
static |
Is a tile on a line.
| T | The user-defined type representing a tile (needs to implement the ITile interface) |
| grid | A two-dimensional array of tiles |
| tile | A tile |
| start | The start tile of the line |
| endPosition | The line destination virtual coordinates (do not need to be into grid range) |
| allowDiagonals | Allows the diagonals or not. Default is true |
| favorVertical | If diagonals are disabled then favor vertical when a diagonal should have been used. False will favor horizontal and is the default value. |
| T | : | ITile |
|
static |
Is a tile on a line.
| T | The user-defined type representing a tile (needs to implement the ITile interface) |
| grid | A two-dimensional array of tiles |
| tile | A tile |
| start | The start tile of the line |
| length | The length of the line |
| directionAngle | The cone direction angle in degrees. 0 represents a direction pointing to the right in 2D coordinates |
| allowDiagonals | Allows the diagonals or not. Default is true |
| favorVertical | If diagonals are disabled then favor vertical when a diagonal should have been used. False will favor horizontal and is the default value. |
| T | : | ITile |
|
static |
Is a tile on a line.
| T | The user-defined type representing a tile (needs to implement the ITile interface) |
| grid | A two-dimensional array of tiles |
| tile | A tile |
| start | The center tile of the rectangle |
| length | The length of the line |
| direction | The Vector2 representing the cone direction. Note that an 'empty' Vector2 (Vector2.zero) will be treated as Vector2.right |
| allowDiagonals | Allows the diagonals or not. Default is true |
| favorVertical | If diagonals are disabled then favor vertical when a diagonal should have been used. False will favor horizontal and is the default value. |
| T | : | ITile |
|
static |
Is a tile on a line.
| T | The user-defined type representing a tile (needs to implement the ITile interface) |
| grid | A two-dimensional array of tiles |
| tile | A tile |
| start | The start tile of the line |
| destinationTile | The destination tile of the line |
| allowDiagonals | Allows the diagonals or not. Default is true |
| favorVertical | If diagonals are disabled then favor vertical when a diagonal should have been used. False will favor horizontal and is the default value. |
| T | : | ITile |
|
static |
Is this tile on a rectangle outline or not.
| T | The user-defined type representing a tile (needs to implement the ITile interface) |
| grid | A two-dimensional array of tiles |
| tile | A tile |
| center | The center tile of the rectangle |
| rectangleExtends | The Vector2Int representing the extends of the rectangle from the center |
| T | : | ITile |
|
static |
Is a tile an orthogonal neighbour of another tile.
| T | The user-defined type representing a tile (needs to implement the ITile interface) |
| neighbour | The tile to check as a neighbour |
| center | A tile |
| includeWalls | Include the non-walkable tiles into the resulting array or not. Default is true |
| T | : | ITile |