Is it possible to create a GridBrush that mimics rule tiles?

TL;DR
Is it possible to read tilemap tiles from GridBrush and then call for example tilemap.RefreshTile(position) from brush?

Scriptable Tiles update every Tilemap update (not every but when they are updated) whereas brush only changes tiles when painting. So I was thinking, could it be possible to create a custom Tilemap brush (GridBrush) instead that could paint tiles in similar manner to rule tile, by getting the neighbor tiles of paint target Tilemap and then adjust brush tile sprite accordingly.

This way I could get the benefits of automatic tile selection, but keep the run-time tiles static and override paint results without altering neighbor tiles.

I got the GridBrush working, I can get the target Tilemap, override the tile that has been picked from the Tile Palette, and I can draw this tile in paint target Tilemap. However, I tried to replicate similar Tilemap updating functionality that we can see in 2d extras examples but I couldn’t get Tilemap to update, either I did something wrong or I don’t understand how this part of Tilemap works (will take another look at the code tomorrow).

1 Like

I will answer this myself after testing this more - yes it is possible to read and update tiles from brush… not sure if it was intended so, but it works:

5235083--522326--blob_tile_brush.gif

Although I wonder why there isn’t any examples of such brushes (or I have missed such examples).

1 Like

Sorry to necro this but how did you go about that?