Method InitTileGrid
InitTileGrid<TPoint, TCell>(IGrid<TPoint, TCell>, GridMap<TPoint>, TCell, GameObject, Action<TPoint, TCell>)
A convenience method to initialize a grid of SpriteCells from code.
public static void InitTileGrid<TPoint, TCell>(IGrid<TPoint, TCell> grid, GridMap<TPoint> map, TCell cellPrefab, GameObject gridRoot, Action<TPoint, TCell> initCellAction) where TCell : Component
Parameters
gridIGrid<TPoint, TCell>A grid in which newly instantiate cells will be placed.
mapGridMap<TPoint>A map that will convert between grid points and world points.
cellPrefabTCellThe prefab that will be used to instantiate cells from.
gridRootGameObjectThe object to use as root for the instantiated cells.
initCellActionAction<TPoint, TCell>A function that can be used to initialize the cell at the given point.
Type Parameters
TPointThe point type of the grid to initialize.
TCellThe cell type of the grid.