Hi, in the recent 2019.2 beta, we have moved the Tile Palette and its related Editor Tooling features to a Unity package in Package Manager. This resulted in some changes which would affect upgrading existing Tilemap projects, for example: changes in the namespace from UnityEditor to UnityEditor.Tilemaps and the addition of a “Unity.2D.Tilemap.Editor” Assembly Definition.
If you have tried out the Tilemap Editor package in 2019.2, were there any issues when upgrading from your previous Unity project? If there were major issues, could you post them here?
Ah I suppose I misunderstood the purpose of this feature. I thought that this meant that we can finally drag any prefab and make it into a tile (i.e. paint with prefabs and not sprites).
There will be an update for the Tile Palette in the future so that you can place GameObjects and Instanced Prefabs on the Tile Palette. These will not be converted to Tiles on the Tile Palette. Handling of these GameObjects will require the use of the Prefab/GameObject Brush from 2d extras instead of the default Brush.
The requirement of the dragging of GameObject Prefabs will still require a minimum of a Grid component (without the Tilemap component).
So currently, you can drag GameObject prefabs that have a Grid and Tilemap component into the palette, so that you can “paint” directly onto those prefabs (instead of drawing to a tilemap in the scene hierarchy).
But as of right now, theres no way to have GameObjects as a tile itself in your palette that you can select and paint with. I have to use the Prefab Brush from 2d extras as it is for now?
In the future update, you mention that we will be able to place GameObjects and Instanced Prefabs in the palette, but still need to use the GameObject brush. Will the brush automatically update its reference to the gameobject you have selected in the palette?
Currently my problem with the 2d Extras prefab brush is that its so cumbersome to paint various prefabs. Either I have to create an entirely new brush for each prefab i want to paint, or i have to keep dragging in a new reference
Technically, it is possible to have a Tile with a GameObject set in it and place that Tile in the Tile Palette. The GameObject property is hidden in the Inspector for the Tile, but can be exposed through scripting or if the inspector is set in the Debug mode.
Yes, using the Pick tool, the GameObject brush will pick the GameObjects in the selection in the Tile Palette and you will be able to paint with these GameObjects.
The update in the future to the TilePalette with the GameObject brush will help with this!
Do the dragging of these GameObjects and Prefab Instances inside tile pallet area of tile pallets window require this objects to have a Grid component?
This seems illogical to me. Becouse those objects will not be treated as tilemaps iNstead they will be placed at tilemaps.
I guess that you might want to create a grid, populate it with one or multiple gameObjects as childs, drag and drop it in the tile palette, and by doing so, creating a palette populated with the gameObjects that were the childs of that grid, that will be ordered in that palette the same way they were in the grid prefab. (Not sure I understood that correctly, but that seems to be a pretty nice workflow to me)
The GameObject used as the Tile Palette will need to have a Grid component (and a Tilemap component currently). The GameObjects and the Prefabs you wish to place on the Tile Palette will not have these requirements.
The thread was opened as the code for the Tile Palette has been moved to a Unity Package handled by the Package Manager instead of being embedded with the Unity Editor itself. This does change your project a little as you would now need to include the 2D Tilemap Editor package in your project if you are using it. Upgrading from 2018.3 to 2019.2 should automatically add it for you. Also, some of the namespaces for Tilemap related classes have changed which require a script update, where the Unity API updater will do its best to update your scripts. If you are using Assembly Definitions referencing the Tile Palette, you will need to add the new Tile Palette Assembly Definitions to your Assembly Definitions. None of your Tilemap data is affected with the upgrade.
In short, we have tried to cover most of the cases you will have issues with upgrading automatically. I do not believe that your project will be affected negatively when upgrading from 2018.3 to 2019.2. However, if you do have problems, this thread is open and we will help you with your upgrading issues.
Hmmm, I believe that API for creating a palette is not public. I will change it so that it is public.
Adding a Tile to an existing Palette in the Editor can be done by:
var palette = AssetDatabase.LoadAssetAtPath<GameObject>(path);
var tile = AssetDatabase.LoadAssetAtPath<TileBase>(tilePath);
var tilemap = palette.GetComponentInChildren<Tilemap>();
tilemap.SetTile(position, tile);
PrefabUtility.SaveAsPrefabAssetAndConnect(palette, path, InteractionMode.UserAction);
You will probably get better response if you ask this in the 2D forum, rather than in this thread, as this thread is more about Tilemap issues while upgrading to 2019.2.