示例#1
0
 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);
 }
示例#2
0
    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);
    }