Bundling Workflow
To make a compatible prefab:
OR
- Select a Grid with child Tilemaps or a single Tilemap,
- Make a Grid Selection using the Tile Palette or Tile+Painter.
Then use the Hierarchy window’s TilePlus Bundler context-menu command or the main menu’s Tools/TilePlus/Archive Tilemaps command.
If a Grid or a single Tilemap is selected, then all the tiles and child Prefabs of the Tilemaps are bundled.
If a Grid Selection exists, you’ll be prompted to confirm that you want to use the Grid Selection to limit which tiles and Prefabs are bundled. If so, ALL tiles and Prefabs in all of the Grid's child Tilemap(s) within the selection are archived.
This command archives Tilemap contents into one or more TpTileBundle assets (Bundles, from now on).
These are the two modes of operation:
- Archive a single selected Tilemap into a Bundle asset along with a TileFab asset.
- Archive a single selected Grid and its child Tilemaps into multiple Bundle assets along with a TileFab asset.
To be clear: You can only archive a Grid with child Tilemaps and any Prefabs parented to the Tilemaps. If you try to use a multiple selection, or any Grid or Tilemap are in or part of a prefab, then the process will complain and quit.
The bundler generally follows this process:
- Is the Grid or Tilemap in a prefab or are you editing in a preview scene? Start again.
- If the selection was not a grid, you’re asked if you want to continue. No: Start again
- If the selection isn’t a grid, then you can’t make a prefab, just archives.
- For each tilemap:
- Is the Tilemap part of a Prefab? Start again.
- Select destination folder. Advice: use a different folder each time!
- Is the folder the Assets folder? Start again.
- You can provide a 'base' name for the generated assets.
- If the selection was a single Tilemap, you’re asked if you want to add any Prefab instances which are children of the Tilemap GameObject.
It’s simpler than that sounds! The choices are presented to you via several dialog boxes and file pickers.
With this information, the bundler creates the TpTileBundle assets: one for each Tilemap, then adds all the TPT tiles to the asset. For Unity tiles, it preserves the information in the Tilemap for each tile (color, transform matrix, and flags) as well as a reference to the original Unity tile asset.
If you elect to archive prefabs, please note that references to the prefab assets are archived; new copies of the prefabs aren’t created. This means that if you delete one of these prefabs then the reference is null, and the prefab won’t be available when the TpTileBundle asset is used.
Note that GameObjects that are instantiated because the Tiles’ GameObject field caused the Tile to instance a GameObject into the scene are not archived. When the TpTileBundle asset is painted (programmatically or via the Tile+Painter) the Tiles re-create the prefab in the scene for you.
A TileFab asset is also created in the same folder. This asset has references to all the new TpTileBundle assets and is used with the TpAnimZoneLoader tile or for loading using methods in the TileFabLib library.
TilePlus tiles archived into Bundles have a special status: they're 'Locked'. This locked status is a hint to Tile+Painter and the Tile+Brush to use particular care when it encounters TilePlus tiles in that state. Normally, such tiles are either cloned prior to placing them onto a Tilemap in a live scene or they clone themselves when placed. So this Locked state is usually invisible to you as a user.