TilemapExtended
TilemapExtended : MonoBehaviour
The main component which stores cell data and manages the correct methods depending on the grip type in use.
Properties
Serialized
Name | Type | Description |
---|---|---|
grid | Grid | The grid object holding tilemaps in use |
tilemaps | Tilemap[] | The tilemaps used to scan tiles for data storage |
tileRules | TileRules | Reference to the rule container used for scanning |
Public
Name | Type | Description |
---|---|---|
DataCells | CellDataStore | DataCell store |
GridExtended | GridExtended | Main class for grid based methods |
Pathfinder | Pathfinder | Path to the resource |
Public methods
Initialize
public void Initialize(Grid newGrid, Tilemap[] newTilemaps)
Initializes TilemapExtended with the given grid and tilemaps. This method can be used to assign grid and tilemaps dynamically at runtime.
caution
Keep in mind that cell data, grid utility methods and pathfinding will only function correctly after initialization.
Parameters
newGrid
: The grid object you wish to assign.newTilemaps
: The tilemap collection that will be used for scanning tiles (can be a single tilemap).
Example
//Find the TilemapExtended object
var tilemapExtended = GameObject.Find("TilemapExtended").GetComponent<TilemapExtended>();
//Find the grid object and get all tilemap children compoments
var grid = GameObject.Find("MyGrid");
var tilemaps = grid.GetComponentsInChildren<Tilemap>();
//TilemapExtended will now be initialized and scan tiles
tilemapExtended.Initialize(grid, tilemaps);