Methods
Cells Modification
void AddCell(Vector3Int coords, TileLayer layer)
-
Description: Adds a tile cell at the specified coordinates using the specified layer. If no layer is provided, defaults to the first tile layer.
-
Parameters:
- Vector3Int coords
: Coordinates for placing the cell.
- TileLayer layer
: The layer to which the cell belongs.
- Usage:
void ModifyCell(Vector3Int coords, TileLayer layer)
-
Description: Modifies an existing tile cell at the specified coordinates by applying the given layer. If
null
, the cell is removed. -
Parameters:
- Vector3Int coords
: Coordinates of the cell to modify.
- TileLayer layer
: The new layer for the cell.
- Usage:
void RemoveCell(Vector3Int coords)
-
Description: Removes the tile cell at the specified coordinates.
-
Parameters:
- Vector3Int coords
: Coordinates of the cell to remove.
- Usage:
Utils
Tile GetTileAtCell(Vector3Int coords)
-
Description: Retrieves the tile at the specified coordinates.
-
Parameters:
- Vector3Int coords
: Coordinates of the cell.
-
Returns:
Tile
at the specified location, ornull
if no tile exists. -
Usage:
TileLayer GetTileLayerAtCell(Vector3Int coords)
-
Description: Retrieves the tile layer at the specified coordinates.
-
Parameters:
- Vector3Int coords
: Coordinates of the cell.
-
Returns:
TileLayer
of the cell, ornull
if no layer is set. -
Usage:
int GetTileLayerIndex(TileLayer layer)
-
Description: Retrieves the index of the specified tile layer.
-
Parameters:
- TileLayer layer
: The tile layer whose index is required.
-
Returns: Integer index of the layer.
-
Usage:
TileLayer GetTileLayer(int index)
-
Description: Retrieves the tile layer by its index.
-
Parameters:
- int index
: Index of the tile layer.
-
Returns:
TileLayer
at the specified index. -
Usage:
Baking
void Bake()
-
Description: Initializes the grid and pre-generates cells within a specified size range.
-
Usage:
void ShowBakedTilemaps()
-
Description: Displays all baked tilemaps on the screen.
void HideBakedTilemaps()
-
Description: Hides all baked tilemaps.
void ClearBakedTilemaps()
-
Description: Clears all baked tilemaps, removing them from the display and memory.
Configuration and Serialized Fields
-
placeholderTilemap (
Tilemap
): Reference to the placeholder tilemap used for layer management. -
displayTileLayer (
GameObject
): Prefab for display tile layers. -
tileLayers (
TileLayer[]
): Array of tile layers available for display. -
bakeSize (
int
): Specifies the size range for theBake()
function, defaulting to 30.