Hey everyone,
Been trying for a while now to get the following working:
newSetOfTiles.Add(poppedWall.getHexKey(), poppedWall);
InMaze.Add(newSetOfTiles);
TileData tempData = new TileData();
Vector3Int tempPosition = new Vector3Int(poppedWall.getHexKey().row, poppedWall.getHexKey().column, 0);
ITilemap resourceTileHolder1 = null;
resourceTileHolderOriginal.GetTile(tempPosition).GetTileData(tempPosition, resourceTileHolder1, ref tempData);
tempData.gameObject.SetActive(false);
Now for a little background. I’m attempting to use Kruskal’s algorithm to remove walls in order to build the maze. All the walls have been added to the original tilemap “ResourceTileHolderOriginal”, so I am attempting to remove the unnecessary walls using Kruskal’s.
However, my attempts to use SetTile to remove have failed. I used the coordinates of the tile and attempted to null the tile there, but no tiles were removed.
resourceTileHolder.SetTile(new Vector3Int(poppedWall.getHexKey().row, poppedWall.getHexKey().column, 0), null);
So I found SetActive, which I am attempting to currently use with TileData. However, in order to get said TileData (aka tempData), I need to reference iTilemap.
GetTileData(tempPosition, resourceTileHolder1, ref tempData);
Question is, how? The current code at top is a runtime error with a NullPointerException, obviously due to “resourceTileHolder1” being null. There is 0 documentation on how to get iTilemap, and every document that I have see so far have USED iTilemap, but no mention on how it was originally passed.
Any information on how to get iTilemap would be welcomed. Help on fixing the code is secondary in my mind to the importance of understanding iTilemap more.
Thank you.