要选择游戏对象,请在 Scene 视图中单击该游戏对象,或在 Hierarchy 窗口中单击其名称。要选择或取消选择多个游戏对象,请在单击时按住 Shift 键,或拖拽一个矩形来框选多个游戏对象。
Selected GameObjects are highlighted in the Scene view. By default, this highlight is an orange outline around the GameObject; to change the highlight color and style, go to Unity > Preferences > Color and edit the Selected Wireframe and Seleted Outline colours. See documentation on the Gizmo Menu for more information about the outline and wireframe selection visualizations. The selected GameObjects also display a Gizmo in the Scene view if you have one of the four Transform tools selected:
Use the four Transform tools in the toolbar to Move, Rotate, Scale, or Rect Transform individual GameObjects. Each has a corresponding Gizmo that appears around the selected GameObject in the Scene view. To alter the Transform component of the GameObject, use the mouse to manipulate any Gizmo axis, or type values directly into the number fields of the Transform component in the Inspector.
Alternatively, you can select each of the four Transform modes with a hotkey: W for Move, E for Rotate, R for Scale and T for RectTransform.
At the center of the Move Gizmo, there are three small squares you can use to drag the GameObject within a single plane (meaning you can move two axes at once while the third keeps still). If you have a three-button mouse, click the middle mouse button and drag to adjust the axis that was most recently moved (the arrow for this axis will change to yellow).
如果在移动辅助图标的中心单击并拖动时按住 Shift,则辅助图标的中心将变为平面方块。平面方块表示可相对于 Scene 视图摄像机所面向的方向在平面上移动游戏对象。
With the Rotate tool selected, change the GameObject’s rotation by clicking and dragging the axes of the wireframe sphere Gizmo that appears around it. As with the Move Gizmo, the last axis you changed will be colored yellow; adjust this further by clicking the middle mouse button and dragging. Think of the red, green and blue circles as performing rotation around the red, green and blue axes that appear in the Move mode (red is the x-axis, green in the y-axis, and blue is the z-axis). Finally, use the outermost circle to rotate the GameObject around the Scene view z-axis. Think of this as rotating in screen space.
The Scale tool lets you rescale the GameObject evenly on all axes at once by clicking and dragging on the cube at the center of the Gizmo. You can also scale the axes individually, but you should take care if you do this when there are child GameObjects, because the effect can look quite strange. Again, the last axis changed appears in yellow and can be adjusted by dragging with the middle mouse button.
矩形变换通常用于定位 2D 元素(如精灵或 UI 元素),但也可用于操作 3D 游戏对象。此工具将移动、缩放和旋转功能整合到了同一个辅助图标中:
请注意,在 2D 模式下,无法使用辅助图标更改场景中的 z 轴。但是,某些脚本技术可将 z 轴用于其他目的,因此仍然可以使用 Inspector 中的变换组件设置 z 轴。
有关变换游戏对象的更多信息,请参阅关于变换组件的文档。
__辅助图标控制柄位置开关__可定义变换组件工具辅助图标的位置以及用于操纵辅助图标本身的控制柄。
单击左侧的 Pivot/Center 按钮可在 Pivot 和 Center 之间切换。
单击右侧的 Local/Global 按钮可在 Local 和 Global 之间切换。
While dragging any Gizmo Axis using the Move tool, hold the Control key (Command on Mac) to snap to increments defined in the Snap Settings (menu: Edit > Snap Settings…)
While dragging in the center using the Move tool, hold Shift and Control (Command on Mac) to quickly snap the GameObject to the intersection of any Collider.
While using the Rotate tool, hold Shift and Control (Command on Mac) to rotate the GameObject towards a point on the surface of any Collider.
使用__顶点对齐__可快速组合场景:从给定的网格中获取任何顶点,并将该顶点放置在与您选择的任何其他网格中的任何顶点相同的位置。例如,使用顶点对齐在赛车游戏中精确对齐路段,或者在网格的顶点定位能量块。
按照以下步骤使用顶点对齐:
2.按住 V 键激活顶点对齐模式。
3.将光标移动到网格上要用作轴心点的顶点上。
4.当光标位于所需顶点上方时按住鼠标左键,将网格拖动到另一个网格上的任何其他顶点旁边。
5.对结果感到满意时,松开鼠标按键和 V 键(__Shift+V__ 用作此功能的开关)。
注意:可将顶点对齐到顶点,将顶点对齐到表面,将轴心对齐到顶点。