Overview
TileCoord is the core coordinate type used by the simulation layer. It represents grid positions using integer X and Y values, where Y maps to the world Z axis in 3D scenes.
Inspector Settings
TileCoord is a serializable struct, not a component. It has no Inspector settings by itself.
Public API
ChebyshevDistanceTo(TileCoord other)Returns distance where diagonal movement counts as one step.
ManhattanDistanceTo(TileCoord other)Returns distance where only cardinal movement counts.
IsCardinalNeighbor(TileCoord other)True when the other tile is directly north, south, east, or west.
IsNeighborIncludingDiagonal(TileCoord other)True when the other tile is adjacent, including diagonals.
Runtime Properties
| X | Horizontal tile coordinate mapped to world X. |
|---|---|
| Y | Vertical grid coordinate mapped to world Z. |
| IsValid | False when the coordinate equals TileCoord.Invalid. |
Common Usage
TileCoord tile = new TileCoord(4, 7);
if (tile.IsNeighborIncludingDiagonal(otherTile))
{
// Tiles are adjacent.
}