Skip to main content

TileFabs and Bundles

Recall that a Bundle (TpTileBundle) asset is an archive of a single Tilemap and a TileFab (TpTileFab) asset is a collection of Bundle assets.

A Bundle asset can be painted like any other tile asset, and you can see the preview as you move the mouse pointer. Painting one of these will overwrite any tiles on whatever map is selected in Painter.

Additionally, if the Bundle Tiles View option is checked, the Bundle’s tiles and Prefabs are displayed in a list, and you can paint any of these objects individually. For other interesting things that you can do with Bundles in Painter, see “Fun With Prefabs and Bundles.”

Using a TileFab is a bit trickier: if you examine one you’ll see that each Tilemap in the collection has a specification for the name of a Tilemap or a tag: these are taken from the GameObject parent of the Tilemap component when the TileFab is created.

The idea is that when you paint a TileFab you’re really painting on at least one, but more likely several Tilemaps at the same time with each Bundle referenced by a TileFab corresponding to a particular Tilemap.

However, the Painter has no way of knowing which Bundle is for a particular map in your scene. And you probably don’t want it to guess! Furthermore, the TileFab may have four Bundles, but your scene may have more or fewer than that.

If you select a TileFab in the center column when the window is in Paint mode, you’ll be presented with the names and tags specified in the TileFab. It’s up to you to ensure that they exist. Mismatches are just omitted from previews and Painting.

For example, if you have Scene Tilemaps named A and B but your TileFab has a collection of four Bundle assets with Tilemaps A, B, C, and D then only A and B will be previewed or painted. C and D will be ignored and neither previewed nor painted. If your scene only has Tilemaps named X and Y, then nothing will be previewed or painted.

So, the names or tags must match.

Note that when “Show TileFabs” is checked another toggle becomes visible: “Matches Only.” If that’s checked then only TileFabs which match named Tilemaps/Tags in the scene are shown in the center column list.

“Matches Only” isn’t perfect: if you have multiple scenes loaded with similar Tilemap names and tags you can end up painting a TileFab’s embedded Bundles into different scenes. Be careful.

If you’re using Chunk-Style TileFabs, please see the “Advanced TileFab Use” document’s section on Chunk Snapping.