Table des matières
Once you have added various assets and need to design or manage a Scene, you will mainly be alternating between the Scene view, Hierarchy window, Inspector window, and Toolbar.
In the Hierarchy, you can select which game object you would like to 'inspect' in the Inspector, and then modify its properties or add new behaviors. Once you have selected a game object, you will also be able to use the tools in the Toolbar to Move, Rotate, or Scale the object in the Scene View.
The Scene view will show you the contents of a Scene, but will not represent the actual camera perspective when starting the game.
Let's demonstrate the working procedure by adding a pine tree and moving it next to the player.
In the Hierarchy, select the Player game object.
The Scene View will be your developer camera, which you can move or rotate around in the Scene without it being the actual camera used when the game is played. To quickly focus on a game object in the Scene, you can click the F button on your keyboard and the Camera will automatically move to it. Before you do so, however, you should let Unity know how it should focus on a game object.
In the Unity toolbar, click the Tool Handle Position toggle to show Pivot.
When pressing F to focus, you will now move the Camera to the pivot (center) of the game object.
Move your mouse into the Scene View and press 'F' to focus on the Player game object.
Let's find a game object and add it to the Scene. For the sake of demonstration, let's just take a pine tree, even though it doesn't usually belong to the Training Area. The Tree_Pine_2 is a Prefab. Prefabs are game objects saved in the Assets folder.
In the Project View, search for 'pine tree' and select Tree_Pine_2.
From the Project View, you can simply drag things into the Scene and the object will appear at your mouse cursor and be placed in the Scene when you let go.
Drag Tree_Pine_2 into the Scene, next to the Adventurer.
Next, let's use the Move, Scale, and Rotate tools to fit the pine tree on the grass in front of the player. However, to be able to place the pine tree on grass, you need to adjust the Scene View to look at both the pine tree and the grass area.
Right-click using the mouse, and drag the mouse to the right until you see both the pine tree and grass area.
Let's zoom a bit out to get a better overview.
Hold down Alt while right-clicking the mouse and dragging it upwards.
You are now ready to move the pine tree into place.
In the Toolbar, select the Move tool.
When selected, at the root of the pine tree you will find three arrows.
You can move the tree by clicking and holding down on one of the arrows, then dragging the mouse along that arrow's axis.
Use the arrows to position the tree on grass.
Let's now give the pine tree a proper name.
In the Inspector, rename Tree_Pine_2 to 'TheLonelyPineTree'.
You will now see the name TheLonelyPineTree in the Hierarchy as well, thereby allowing you to find it more easily in the future.
You should now have a better understanding of how to use these windows in connection with each other, but there are many other ways to use these windows.