private void InitCellGrids() { gridCells = CellGrid <CellGridData <T> > .Create(gridCount.x, gridCount.y); for (int x = 0; x < gridCount.x; x++) { for (int y = 0; y < gridCount.y; y++) { var gridCell = gridCells.GetCell(x, y); var subGrid = CellGrid <T> .Create(cellCount.x, cellCount.y, gridCell); var gridData = new CellGridData <T>() { cellGrid = subGrid, cellGridWorldPosition = navWorldOrigin + new Vector3(x * gridSpacingX, 0, y * gridSpacingY) }; gridCell.data = gridData; } } Debug.Log(gridCells.GetCells().Length + " grids created"); }
public Cell <CellGridData <T> >[] GetAllGridCells() { return(gridCells.GetCells()); }