private void WriteTileLayer(ContentWriter output, TileMapTileLayer layer) { output.Write(layer.Id); output.Write(layer.Name ?? string.Empty); output.Write(layer.Width); output.Write(layer.Height); foreach (var tile in layer.TileMatrix) { output.Write(tile?.Id ?? 0); } }
private IEnumerable <TileMapTileLayer> ReadLayers(ContentReader input, TileMap tilemap) { int layerCount = input.ReadInt32(); List <TileMapTileLayer> tileLayers = new List <TileMapTileLayer>(); for (int i = 0; i < layerCount; i++) { int id = input.ReadInt32(); string name = input.ReadString(); int width = input.ReadInt32(); int height = input.ReadInt32(); var matrix = ReadTileMatrix(input, width, height); TileMapTileLayer layer = new TileMapTileLayer(tilemap, id, name, matrix); tileLayers.Add(layer); } return(tileLayers); }
public TileMapLayerRenderer(TileMapTileLayer tileMapTileLayer) { TileMapTileLayer = tileMapTileLayer; }