Hi I'm making a 2d dot game. As you can see in the picture, I have a map prefab and the tile palette. What I want to do is switch those map setting to another palette. How can I do that?? Please help me.
Hi, could you explain with more details on what you want to do? Having screenshots would help as well, thanks!
For example, If we want to make a new game Map prefabs with same location tiles but using different tiles(Color, texture or something else), we have to create a new one and we think this is waste of time. So What I want to do is just change the tile palette and the game map prefab changes too! Is this possible work?
Hi @JKH "I want to do is just change the tile palette and the game map prefab changes too!" BTW - Tile Palette is a Tilemap with its Renderer disabled. You can test this by dragging your Tile Palette into your scene, it will look like this (Tilemap object is hidden in asset file, so it doesn't show up in Project view): So it is a palette of tiles (created using Tiles on Tilemap). Tiles themselves are asset files in your project, and those asset files define how your tile looks. So, AFAIK - modifying a Tilemap (of Tile Palette) alone wouldn't change your scene Tilemap...
Hi, Thank you for the explanation. I thought if there is any way to do it. Thank you very much anyway
@JKH I would simply have a folder of matching tile asset files and by pass the whole palette. I have no idea if there are some limitations with this method, but it worked for me. Using editor scripting, get the tiles of your tilemap, process each tile, replace it with a different version from another folder:
I added a small example at https://github.com/Unity-Technologies/2d-techdemos/tree/master/Assets/Tilemap/PaletteSwap which you can run and try out (Press the A and D keys in Playmode to swap). The assumption here would be that the Tiles that you want to swap in the Tile Palettes have the same relative position inside them. Feel free to adjust the logic for your own needs!