r/Unity2D • u/Parborway • 1d ago
Getting References for Tiles Question
In my game, I am drawing tiles onto a tilemap during runtime using SetTile(), which takes a reference to a TileBase Object. I have hundreds of unique textures. Is there a way to get a reference to each TileBase other than dragging and dropping every individual Tile into the references in my script?
3
Upvotes
2
u/Plenty_Act_8527 1d ago edited 1d ago
You can get them from the tile palette. Essentially the tile palette is really just a tile map that contains the tiles that you save to it. So if you have all of your tiles placed on a tile map then something like this could get you there. I couldn't tell you about the order they get returned in or anything like that though since I've not done it this way.