public void ResetCells() { for (int z = 0, i = 0; z < height; ++z) { for (int x = 0; x < width; ++x) { MapCell cell = cells[i++]; cell.color = defaultColor; } } mapMesh.Triangulate(cells); }
public void CreateMapCells() { gridCanvas = GetComponentInChildren <Canvas>(); mapMesh = GetComponentInChildren <MapMesh>(); cells = new MapCell[height * width]; for (int z = 0, i = 0; z < height; ++z) { for (int x = 0; x < width; ++x) { CreateCell(x, z, i++); } } mapMesh.Triangulate(cells); }