Tiles are created as prefabs.
In my previous approaches I’ve created a single plane to act as the ground and then generated objects on top of the plane. When programing in Java etc, this saved resources and helped to reduce the number of objects generated. However, it seems like unity is ok with generating a prefab for each tile on the screen. I’m not sure how light-weight the prefabs are, but, considering there were a lot of objects in my last project, the number of prefabs doesn’t seem to bog unity down too much so I’m going to try out this system and see how it goes.
Snap to grid feature.
This is the coolest feature I’ve seen in unity for a 2d game. When clicking on a prefab select Edit>SnapToGrid and it will show a dialogue box that lets you customize how the prefab will try to line up with the grid underneath. After that is selected, holding control will allow prefabs to snap to the next available space when moving them around. Using this approach I was able to create a small map very quickly. Looks like using this system will save a lot of time when creating tile-based maps.
Using game objects to organize.
Looks like empty game objects are used to hold all tiles related to maps. We did some of this in my last project, and it certainly worked, but I wasn’t sure if it was standard practice in unity.
Used this feature in previous implementations. makes sense for a 2d game, but I’d like to mess with the perspective camera to get a more picture book-y feel for a game like “The Woods”.