Version: 5.6
Scene 视图导航
Scene 视图控制栏

游戏对象定位

要选择游戏对象,请在 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.

The Move, Scale, Rotate, and Rect Transform Gizmos
The Move, Scale, Rotate, and Rect Transform Gizmos

移动

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 按钮可在 PivotCenter 之间切换。

  • Pivot 将辅助图标定位在网格的实际轴心点。
  • Center 将辅助图标定位在游戏对象渲染边界的中心。

旋转

单击右侧的 Local/Global 按钮可在 LocalGlobal 之间切换。

  • 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.

顶点对齐

使用__顶点对齐__可快速组合场景:从给定的网格中获取任何顶点,并将该顶点放置在与您选择的任何其他网格中的任何顶点相同的位置。例如,使用顶点对齐在赛车游戏中精确对齐路段,或者在网格的顶点定位能量块。

按照以下步骤使用顶点对齐:

1.选择要操作的网格,并确保__移动__工具处于活动状态。

2.按住 V 键激活顶点对齐模式。

3.将光标移动到网格上要用作轴心点的顶点上。

4.当光标位于所需顶点上方时按住鼠标左键,将网格拖动到另一个网格上的任何其他顶点旁边。

5.对结果感到满意时,松开鼠标按键和 V 键(__Shift+V__ 用作此功能的开关)。

注意:可将顶点对齐到顶点,将顶点对齐到表面,将轴心对齐到顶点。

Scene 视图导航
Scene 视图控制栏