The Hierarchy Window
层级窗口
The Hierarchy contains every GameObject in the current Scene. Some of these are direct instances of asset files like 3D models, and others are instances of Prefabs, custom objects that will make up much of your game. You can select objects in the Hierarchy and drag one object onto another to make use of Parenting (see below). As objects are added and removed in the scene, they will appear and disappear from the Hierarchy as well. By default the GameObjects will be listed in the Hierarchy window in the order they are made. It is possible to re-order the GameObjects by dragging them up or down, or making them children or parents.
层级窗口包含了所以现成场景中每一个游戏对象.它们中的一些是资源文件的实例如3D模型和其他预设物体和自定义对象的实例,用于组成你的游戏.你可以拖拽一个对象到另一个对象上作为子对象.当对象在场景中被添加或删除时同样也会在层级窗口内显示或消失.默认游戏对象会在层级窗口内按照它们的创建顺序排序.也可以通过上下拖拽来重新排列或设置它们为子或父对象.
Parenting
设置父子关系
Unity uses a concept called Parenting. To make any GameObject the child of another, drag the desired child onto the desired parent in the Hierarchy. A child will inherit the movement and rotation of its parent. You can use a parent object’s foldout arrow to show or hide its children as necessary. Alt-clicking the parent’s foldout arrow will show or hide all descendent GameObjects of the parent, in addition to the immediate children.
Unity使用一个概念叫设置父子关系.在层级窗口上拖拽要作为子对象的到要作为父对象的上,来设置任何游戏对象父子关系.子对象会继承父对象的移动和旋转.必要时你可以通过父对象的折叠箭头来显示或隐藏它们的子对象.按住alt点击父对象的折叠箭头将显示或隐藏所有派生的子对象,和直接子对象.
Two unparented objects
没有父子关系的两个对象
One object parented to another
一个对象从属于另一个
To learn more about parenting, see the Transform Component page.
学习更多关于父子关系,参考”方向组件”页面.
Alphanumeric Sorting
字母数字排序
The order of GameObjects in the Hierarchy window can be changed into alphanumeric order. This mode can be enabled using the Edit->Preferences menu (Windows) or Unity->Preferences menu (Mac) which launches the Unity Preferences window. The “Enable Alpha Numeric Sorting” can be ticked. Once this is made the order of the GameObjects in the Hierarchy can be made into alphanumberic sorting. A new icon appears at the top right-hand side of the Hierarchy window. A drop-down appears which lets you choose Alphabetic or Transform sort.
层级窗口的游戏对象可以改为按字母数字排序.此模式可以通过使用菜单编辑>首选项(Window系统)或Unity>首选项(Mac系统)打开首选项窗口来设置.
Multi-Scene Editing
多场景编辑
It is possible to have more than one Scene open in the Hierarchy at the same time. To find out more about this, see the Multi Scene Editing page.
有时可能有多个场景在层级窗口上同时打开.更多关于此,请参考”多场景编辑”页面.