Interface ********* .. note:: An **Asset** corresponds to any file or resource that is used in your project: 3D models, 2D sprite, audio file, script, shader, texture, animation. Main windows ============ Standard Layout --------------- * In the Unity HUB, select the blank project, it will automatically open in the Unity Editor. * Identify the main windows of the Unity Editor: .. image:: scene.png :scale: 70% * On the upper left, the **Hierarchy window** displays all the **objects** in the current scene * In the center, the **Scene** view allows us to edit and modify the current scene * On the right, the **Inspector** window lists all the information of the current selected object * At the bottom, in the **Project** window, you can find all the assets of the project displayed in two modes: on the left as a tree structure and on the right as a thumbnail view.. Restoring the Interface ----------------------- While working in the interface, accidents may happen, such as closing an important window or panels disappearing. To solve such an issue, you can use the Unity **Layout** manager to reset windows and panels to their original positions. * Extend, move and close some windows randomly * In the top right corner of the Unity main window, find the hidden dropdown button .. image:: layout.png :scale: 60% * Click on this button and select "Default" Project/Assets windows ====================== Starting a New Scene -------------------- .. warning:: Unity developers generally create a separate folder for each type of element: a folder named Scripts for all the game's scripts, a folder named Textures for all textures, and so on. For our needs, it is simpler to create one folder per project and store all the project assets within it. * In the Project window, select the folder named **Assets > Scenes** .. image:: psce.png :scale: 50% * In the Assets window, in an empty area of the thumbnail view, right click to open the context menu .. image:: createFolder.png :scale: 50% * Select Create > folder * Name this folder *Intro* .. image:: intro.png :scale: 35% * Double-click on the *Intro* folder to open it .. image:: empty.png :scale: 45% * Right click to open the context menu * Select Create > Scene > Scene * Name it: *IntroScene* .. image:: introscene.png :scale: 45% * Double click on the scene icon to open it * In the Hierarchy window, check that the name at the top of the hierarchy matches the name of your file: .. image:: hierar.png :scale: 45% Hierarchy window ================ Creating objets --------------- Basic 3D objects can be created through this window: * In the Hierarchy window, right click in an empty area to open the context menu .. image:: create3D.png :scale: 50% * Select *3D object > Cube* * In the assets window, select the folder Assets > SolidColorMaterials * Choose a color * Drag and drop this material onto the cube in the 3D scene .. image:: apply.gif :scale: 80% Hierarchy window ---------------- .. image:: cube.png :scale: 60% * Notice that the cube has been added to the tree * Select this item in the Hierarchy * Press F2 and rename the object to "MyCube" Inspector ========= In the Unity engine, an object in the scene is called a **GameObject**. It is described as a list of components such as Transforms, Renderers, Colliders, and Scripts, which together define its behavior and appearance in the game. * Select "MyCube" in the Hierarchy window The Inspector windows is organized as a stack of dropdown boxes, thus you can find: * At the top: .. image:: ins1.png :scale: 50% * The name of the object: "MyCube" * A checkbox to enable or disable the object in the scene * Check and uncheck the checkbox to disable and reactivate the cube * A tag: using this tag, you can gather objects by category, like enemy or walls, for example * Transform .. image:: transform.png :scale: 50% * A transformation matrix that defines the translation, rotation and scale values relative to the parent object * Mesh filter: defines the 3D geometry * Mesh renderer: rendering information like material, shadows... * Collider: a geometric object that encloses the object and that is used to detect collisions with other objects while minimizing computations