I have a RuleTile that works great when using the SceneView to edit the Tilemap. All my rules work as expected. I have in-game Tilemap editing working with normal Tiles but I'm stumped on how to make it work with RuleTiles. I need the user to be able to adjust place a RuleTile wherever they click. I have a Tilemap that ONLY uses a single RuleTile. No standard Tile are used on this Tilemap. My current attempt is: Code (CSharp): private Tilemap _tilemap; // assigned in CTOR private RuleTile _ruleTile; // assigned in CTOR [SerializeField] private RuleTile _ruleTileSO; // The RuleTile ScriptableObject is dragged here private void DoStuff() { _ruleTile = (RuleTile)_tilemap.GetTile(_pos); if(_ruleTile == null) { _ruleTile = (RuleTile)ScriptableObject.Instantiate(_ruleTileSO); _tilemap.SetTile(_pos, _ruleTile); //_ruleTile.RefreshTile(_pos, _tilemap); // Doesn't compile } } The problem is because RefreshTile() expects an ITilemap and for some reason Tilemap doesn't implement ITilemap. Without refreshing the tile, it draws the RuleTile's default Sprite in every cell and never updates itself or neighbors based on the rules. I'm sure this is simple and I'm missing something but I'm not seeing it. I'm also confused why Tilemap wouldn't implement ITilemap. Any ideas? Thanks in advance!
I'm still stumped and am unable to figure out how to refresh a RuleTile by code due to the fact that RefreshTile requires an ITilemap.
We use the RefreshAllTiles function on Tilemap to do this after all manipulations of tiles are complete. It may be slow for your use case, though.
Thanks @edwardrowe. I'm not sure how I missed that It works for now! I'll let you know if I ever figure out how to only call refresh on the tile that was updated.