So i’m going to create a map scene similar to the one in Slay the Spire, where the Player chooses a path and then they are loaded into a scene for the actual game.
I would have the base map sprite, and create an algorithm to create nodes, draw paths between these nodes, generate node choices etc.
The way i see it is i can either do this all on a canvas where i can instantiate a button for the Player to press which moves them up a path and loads them into a level. For each map this would be about 20 or so buttons. Or i could do this all off the canvas with gameObjects and scripts attached, that have the same functionality as the buttons.
Which way would be cleaner/easier to create? Is there another way i’m missing? Thanks.
There are millions of ways to do this. I’d go with the one that is most comfortable to you and requires the smallest amount of code. Using the canvas seems a natural fit since it’s a metaphor that seems to fit the purpose: your Player draws and interacts with a 2D medium, and Unity comes well equipped to handle this. The only aspect I’d rethink is how many buttons to show at the same time, and perhaps provide a mechanism to show/hide buttons on the fly to reduce Interface clutter.
A canvas is easier to handle with regards to fitting it to the screen, handling different aspect ratios, etc.
Everything else - especially moving things and positioning things like nodes - will be a lot easier without a canvas. If you want any kind of tilt of the map (like in your image), that’ll also be a ton easier to deal without having the canvas there.