Unity Editor Overview

Now that we have the Unity Hub, a version of Unity and Visual Studio 2022 installed we can now go over the Unity editor on our test project we created in the last section.

Identify and use essential features of the Unity Editor

Unity has 5 important areas in the editor interface for building games. The main area is the Scene View, where you design your game. The Hierarchy lists all game objects in the current Scene View. The Projects panel contains additional game assets like audio files, animation clips, or 3D models. The Inspector shows components on a game object and allows adding new ones. The Toolbar has tools to move, scale, and rotate objects, a play, pause, and step button, and the ability to change the editor's layout and see available game layers.

In your 3D scene you are given a few starting game objects, one of them is your Directional Light. This is going to act just like the sun would in real life. Beyond this type of light source, Unity has several others you may want to use in your game scene.

Unity Game Objects

Game objects are at the foundation of any game. They could be the player, an enemy, a collectible, or even an NPC. During the development or learning stages, these objects can start off as a primitive object. Primitive objects are standard geometric shapes, such as a cube, sphere, capsule, cylinder, plane, and quad. While you ultimately want your game to be polished with animations, sounds, effects, and all the game juice, these can get in the way when you are learning.

You’ve created a few primitive shapes in the hierarchy and they are placed randomly around the scene. By default all the primitives are white in color. If you are a 3D modeler or have seen greyscale models before, that is the same as a primitive shape in Unity. To give that model or shape some life you can apply a material to it. This could be a standard color, texture or designed material for that model.

As your game begins to have more and more of the same types of objects in a game or scene, its time to create prefabs to help you out. A prefab is just a clone of template of a game object you created that will need replicating. An example of this would be collectibles or enemies in a game. Once you decide you need a prefab, you should create a folder inside your Assets folder to house all the prefabs you will use in your game. One way to tell if you have a prefab object in your hierarchy is that the game object will be blue and not grey.

Import 3D assets into Unity from the assets store or for a different location.

Create and Manage Scenes

To create and manage scenes in Unity, you can use the File menu and select New Scene to create a new scene. You can also use the Hierarchy panel to manage the game objects in the current scene. To switch between scenes, you can use the Scenes panel, which displays all the scenes in your project. You can also use the Build Settings window to manage the order in which your scenes are loaded and to build your game.

Creating a 2D game in Unity has several benefits. Unity provides a powerful 2D engine that can handle modern 2D games with ease. The engine has a lot of features that are specifically designed for 2D game development, like sprite management, 2D physics, and animations. Unity also has a large community of developers who have created a lot of 2D tools and assets that can be used in your game.

Additionally, Unity allows you to create 2D games that can be deployed on multiple platforms, including mobile, desktop, and web. This makes it easy to reach a large audience and potentially increase the success of your game. Overall, Unity's 2D engine is a great choice for developers who want to create 2D games with modern features and deploy them on multiple platforms.

To navigate in 3D space in the Scene view, you can use the Scene Gizmo and Move Gizmo. The Scene Gizmo is the grid that appears in the Scene view and allows you to move, rotate, and scale objects in the scene. The Move Gizmo is the set of arrows that appears when you select an object and allows you to move it along the X, Y, or Z axis.

You can also use the Hand Tool to move the camera around the scene, and the Zoom Tool to zoom in and out. To rotate the camera, you can hold down the Alt key and left-click and drag the mouse. Finally, you can use the Viewmenu to change the camera projection, show or hide various elements in the Scene view, and more.