How to compile tiles to create shapes?


(I’ve added guide lines to show how the shapes are broken up)

I’ve got shapes that can be dragged around a board. At the moment each shape is its own sprite. I want to use less assets if I have loads of shapes. I also want to be able to generate them in code as it would be so much faster than creating the art. What do you think is the best way to handle generating them?

It doesn’t look like I can generate sprite components in code so each broken up part would have to be a game object. I could use 9 slices for the main parts but the curves inside the “L” shapes would have to be its own object too.

Maybe each shape could be a tilemap but I dunno if that would kill performance.

1 Like

Some quick ideas:
You could have a GO with many sprites (as each tile), and enable only those that you need.
Or, perhaps use a tilemap for each shape (same princible)
Or, generate a texture for each shape and set it on the sprite.

5 Likes

Okay cheers. Yea, the multiple sprites within a GO would be easiest for me to implement. They can always looks into generating a texture if I had to later down the road.