2D mode
Unity has a 2D mode that allows us to quickly set up the project for 2D game development. In fact, the main reason to use this mode is to automatically import new assets as Sprites
.
When creating a new project, you have the option to choose between the 3D and the 2D mode. Let's select the 2D mode, as shown in the following image:
Now, we need to import the standard assets that we will use to build our game. Click on Asset packages and select 2D.
Note
Unity doesn't come with the standard packages, you need to download them from the official website.
Finally, we can click on Create project. If you have used Unity before for 3D game development, you will notice a few differences in the default interface. In particular, the 2D view is already selected:
Furthermore, the camera in new scenes will always be orthographic, which is exactly what we want:
Having selected the 2D mode doesn't mean that you cannot change it any more. In fact, you can change it to 3D mode whenever you want by going to Edit | Project Settings | Editor and selecting 3D under Default Behavior Mode.
This can come in handy when adding 3D models to your 2D project and vice versa. It is recommended that you switch before importing 2D sprites or 3D models to the appropriate mode since Unity will import textures accordingly.