Sorry, can you explain in more detail how this can be done? I've tried using tilemap.ColorChannel.SetColor(tileX, tileY, Color), but I keep getting DivideByZeroExceptions. The culprit is "divX" inside SetColor function of tk2dTileMapChunks script. I've tried setting the color channel before and after my build call, but to no avail.
This is how I draw to the tilemap currently.
private void _DrawTileLayer(string zlib_64_data, int layer_index) {
byte[] raw_data = Convert.FromBase64String(zlib_64_data);
Stream data_s = new MemoryStream(raw_data, false);
Stream data = new Ionic.Zlib.ZlibStream(data_s, Ionic.Zlib.CompressionMode.Decompress, false);
using (var binary_reader = new BinaryReader(data)) {
int tile_map_height_index;
for (int h = 0; h < curr_level_height; h++) {
tile_map_height_index = tile_map.height - 1 - h; // Some math. TMX counts tiles with top == 0. 2DTK counts with bottom == 0
for (int w = 0; w < curr_level_width; w++) {
uint tile_gid = binary_reader.ReadUInt32();
if (tile_gid == 0) continue;
tile_map.SetTile(w, tile_map_height_index, layer_index, (int)tile_gid - 1);
//tile_map.ColorChannel.SetColor(w, tile_map_height_index, Color.blue); Here, this line causes a DivideByZero exception
tile_map.SetTileFlags(w, tile_map_height_index, layer_index, TILE_FLAGS_MAP[tile_gid >> 29]);
}
}
}
}
After which I call tilemap.Build(). Can you also explain what it means to calculate falloffs?
Also is "vertex painting" the only method to make the tilemaps react to lights? Or is there some other preferred way? Thanks!