Table of Contents

Method InitTileGrid

Namespace
Gamelogic.Grids2
Assembly
Gamelogic.Grids2.dll

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

grid IGrid<TPoint, TCell>

A grid in which newly instantiate cells will be placed.

map GridMap<TPoint>

A map that will convert between grid points and world points.

cellPrefab TCell

The prefab that will be used to instantiate cells from.

gridRoot GameObject

The object to use as root for the instantiated cells.

initCellAction Action<TPoint, TCell>

A function that can be used to initialize the cell at the given point.

Type Parameters

TPoint

The point type of the grid to initialize.

TCell

The cell type of the grid.