Prefabs
In Paint mode, the center column has an option checkbox called: Bundle Tiles View. This checkbox only appears if the “Show Tile Bundles” checkbox is checked.
When unchecked, the Bundle is painted as a single item as usual.
When Bundle Tiles View is checked, the tiles and prefabs from a Bundle are displayed in a list and can be painted individually. When showing Bundles as a list, prefabs in the Bundle can be painted as if you were viewing a Palette of Prefabs.
You can use transform modification shortcuts like ALT+V, ALT+R/T/X/C/Z when previewing Prefabs.
You can also use the presets in the Painter Modifications editor window individually or as a default preset, as discussed in that section.
These changes do not affect Project folder Prefabs asset at all: when you release the mouse button, a copy of the asset is instantiated, has its transform modified (if only to set the position) and then painted.
The only way to affect the Z-position of a Prefab prior to painting it with a Painter Modification preset.
It’s important to note that the preview you see when painting a prefab is an “asset preview,” like the preview seen in an inspector. It’s entirely possible to use the ALT key shortcuts or a Painter Modification preset to create a transform that’ll place the prefab at a position and/or rotation that’d be invisible when the Scene view is in 2D mode. If it appears that your prefab disappears when you paint it, that’s probably what happened.
The Modifications Editor presets allow you to modify the offset from the mouse position, modify the scale, and/or modify the rotation by selecting one of the listed transforms and clicking ALT+V to modify the transform during Preview.
An unmodified transform will paint at the center of the tile cell.
Here’s an example of how to use this productively by creating a Prefabs palette:
- Create a new 2D Scene and add a Tilemap.
- Add all the Prefabs that you want to paint as children of that Tilemap.
- Ensure that they are parented to that single Tilemap.
- Change Painter’s mode to Grid Selection (the third mode button), select the Tilemap with the child prefabs in Painter’s left column, and use the Marquee Shortcut key to draw a marquee around the area that you want to save, click the Grid Selection button, then click the Create Bundle button.
- This will guide you to create a Tile Bundle. The Bundle won’t have any tiles (unless you have painted some) but will have the Prefab references.
If you view this new Bundle in Painter with Bundle Tiles View checked, you can select and paint the prefabs as if this were a Palette of prefabs or you can paint the Bundle all at once, as usual, as sort of a mega-prefab.
Here's the list-view of a (trivial) bundle quickly created using the above process.
For quick Prefab painting, just select one or more Prefabs in a Project folder and use the TilePlus/Add To Painter Favorites context menu item.
An easier approach is to multiple-select Prefabs in a Project folder and use the TilePlus/Bundle Project Prefabs context menu item. This will create a Bundle that you can view in Painter with the Bundle Tiles View toggle set ON and allow you to paint the Prefabs individually. Note that this bundle has fixed positioning of the Prefabs and hence it has limited use: it won’t make sense to paint the entire Bundle. Bundles captured from the scene preserve the transform settings of the Prefab as set in the scene.
Previewing Prefabs
When previewing a Bundle (including previewing a TileFab, which is just a collection of Bundles) up to 128 prefabs can be previewed in total, per preview cycle (which happens several times per second depending on how fast you move the mouse). So, if you have a TileFab with several Bundles and the total number of Prefabs in all the Bundles is greater than 128 then some of the bundled Prefabs won’t preview.
Aside from that, you can preview and paint Bundles (when the Bundle Tiles View option is unchecked) and TileFabs with embedded Prefabs. The preview works the same as described above: they’re asset previews. The only difference is that the transform modification shortcuts are inoperative on groups of prefabs.
One advantage of using Bundles for prefabs is that any transform changes such as rotation and scale are preserved and then restored when the Bundle’s prefabs are painted via Painter or calls to the TileFabLib library. Transform changes don’t show in the preview, and the positioning during preview may be slightly incorrect due to integer math issues.
Prefabs and GridSelection
If there’s a Grid Selection when using the Paint tool and the current Object is a Prefab AND you click into the Grid Selection then the entire selection will be filled with the Prefab, with transform modifications applied if done during preview (when moving the mouse) via a shortcut key.
Additionally, an area fill of Prefabs occurs if you drag out a marquee using the Marquee Shortcut key.
These actions mimic what’s done with tiles.
Erasing or Modifying Prefabs
The Erase tool can’t be used to delete Prefabs in a scene, nor can the Rotate and Flip tools be used on Prefabs in a scene. Once placed in a scene, all further editing must be performed using normal Unity tools for GameObjects.
The only exception is when using the “TilePlus Clear Tilemaps” function from the Tools menu, from the context menu, or via the Clear Tilemaps button in the Grid Selection panel as that function erases all tiles and parented GameObjects in the entire Tilemap or group of Tilemaps.