Ejemplo n.º 1
0
    public void EditLevel(LevelSettings level)
    {
        levelSettings = level;
        savedCells    = new SavedCells(levelSettings.Map);

        width  = savedCells.GridWidth;
        height = savedCells.GridHeight;

        UpdateToolbar();
    }
Ejemplo n.º 2
0
    private void SaveAfterChanging()
    {
        CellData[,] data = new CellData[width, height];

        for (int x = 0; x < width; x++)
        {
            for (int y = 0; y < height; y++)
            {
                data[x, y] = cellsGrid[x, y].cellData;
            }
        }

        savedCells = new SavedCells(data, width, height);
    }
Ejemplo n.º 3
0
    public Map(SavedCells savedCells)
    {
        int width  = savedCells.GridWidth;
        int height = savedCells.GridHeight;

        gridSize = new Vector2Int(width, height);
        cellData = new CellData[width * height];

        for (int x = 0; x < width; x++)
        {
            for (int y = 0; y < height; y++)
            {
                int index = y * width + x;
                cellData[index] = savedCells.Data[x, y];
            }
        }
    }