Scene view Camera
Game 视图

Gizmos 菜单

Scene 视图Game 视图都有 Gizmos 菜单。单击 Scene 视图或 Game 视图的工具栏中的 Gizmos 按钮,即可访问 Gizmos 菜单。

Scene 视图中的 Gizmos 按钮
Scene 视图中的 Gizmos 按钮
Scene 视图或 Game 视图窗口之上的 Gizmos 菜单
Scene 视图或 Game 视图窗口之上的 Gizmos 菜单
属性 功能
3D Icons 3D Icons 复选框控制是否在 Scene 视图中由 Editor 绘制 3D 组件图标(例如光源和摄像机的图标)。

勾选 3D Icons 复选框后,组件图标由 Editor 根据组件与摄像机的距离进行缩放,并被场景中的游戏对象遮挡。可使用滑动条来控制外观的总体大小。未勾选 3D Icons 复选框时,以固定大小绘制组件图标,且这些图标始终绘制在 Scene 视图中所有游戏对象之上。

请参阅下面的辅助图标和图标以查看图像以及更多信息。
Show Grid Show Grid 复选框用于在 Scene 视图中打开(选中)和关闭(取消选中)标准场景测量网格。要更改网格的颜色,请访问 Unity > Preferences > Colors__,然后更改 Grid__ 设置。

此选项仅在 Scene 视图的 Gizmos 菜单中可用;无法在 Game 视图的 Gizmos 菜单中启用该选项。

请参阅下面的 Show Grid 以查看图像以及更多信息。
Selection Outline Check Selection Outline to display selected GameObjects with a colored outline, and their children with a different colored outline. By default, Unity highlights the selected GameObject in orange, and child GameObjects in blue.

NOTE: This option is only available in the Scene view Gizmos menu; you cannot enable it in the Game view Gizmos menu.

See Selection Outline and Selection Wire, below, for images and further information.
Selection Wire 选中 Selection Wire 可以在显示所选的游戏对象时使其线框网格可见。要更改 Selection Wire 的颜色,请选择 Unity > Preferences > Colors__,然后更改 Selected Wireframe__ 设置。

此选项仅在 Scene 视图的 Gizmos 菜单中可用;无法在 Game 视图的 Gizmos 菜单中启用该选项。

请参阅下面的 Selection Outline 和 Selection Wire 以查看图像以及更多信息。
Recently Changed Controls the visibility of the icons and gizmos for components and scripts that you modified recently.

This section appears the first time you change one or more items, and updates after subsequent changes.

For more information, see Built-in components, scripts, and recently changed items, below.
Scripts Controls the visibility of the icons and gizmos for scripts in the Scene.

This section appears only when your Scene uses scripts that meet specific criteria.

See Built-in components, scripts, and recently changed items, below, for further information.
Built-in Components Controls the visibility of the icons and gizmos for all component types that have an icon or gizmo.

See Built-in components, scripts, and recently changed items, below, for further information.

辅助图标和图标

辅助图标

__辅助图标__是与场景中的游戏对象相关联的图形。有些辅助图标仅在选择游戏对象时才会显示,而其他辅助图标由 Editor 显示(无论选择什么游戏对象)。这些辅助图标通常是线框,使用代码而不是位图图形来绘制,还可以交互。摄像机辅助图标和光线方向辅助图标(如下图所示)是内置辅助图标的两个示例;还可以使用脚本来创建自己的辅助图标。请参阅了解视锥体相关文档以了解有关摄像机的更多信息。

有些辅助图标是被动图形覆盖层,显示来供参考(例如,光线方向辅助图标用于显示光线的方向)。其他辅助图标具有交互性,例如音频源 (AudioSource) 球形范围辅助图标,可以单击并拖动此辅助图标来调整音频源的最大范围。

移动缩放、__旋转__和__变换__工具也是交互式辅助图标。请参阅关于游戏对象定位的文档以了解关于这些工具的更多信息。

摄像机辅助图标和光源辅助图标。这些辅助图标仅在被选中时才可见。
摄像机辅助图标和光源辅助图标。这些辅助图标仅在被选中时才可见。

请参阅 OnDrawGizmos 函数的脚本参考页面以了解关于在脚本中实现自定义辅助图标的更多信息。

图标

可以在 Game 视图或 Scene 视图中显示__图标__。图标是扁平、公告牌式覆盖层,可以用来清楚地指示在处理游戏时游戏对象在游戏中的位置。摄像机图标和光源图标便是内置图标的示例;还可以将您自己的图标分配给游戏对象或各个脚本(请参阅关于分配图标的文档以了解如何执行此操作)。

摄像机和光源的内置图标
摄像机和光源的内置图标
左:3D 模式下的图标。右:2D 模式下的图标。
:3D 模式下的图标。:2D 模式下的图标。

Show Grid

Show Grid 功能可在场景平面上启用网格。以下图像显示了网格在 Scene 视图中的显示情况:

左:已启用 Scene 视图网格。右:已禁用 Scene 视图网格。
:已启用 Scene 视图网格。:已禁用 Scene 视图网格。

要更改网格的颜色,请选择 Unity > Preferences > Colors__,然后更改 Grid__ 设置。在此图像中,Scene 视图网格为深蓝色,因此在浅色地板上更显眼:

Selection Outline 和 Selection Wire

Selection Outline

When Selection Outline is enabled, an outline appears around selected GameObjects and their child GameObjects. By default, Unity outlines selected GameObjects in orange, and child GameObjects in blue. You can change these colors in the Unity preferences (see Selection Colors, below).

Selecting a GameObject (the large ladybug) outlines it in orange, and outlines its child GameObjects (the smaller ladybugs) in blue.
Selecting a GameObject (the large ladybug) outlines it in orange, and outlines its child GameObjects (the smaller ladybugs) in blue.

When you select a GameObject, Unity outlines all of its child GameObjects (and their child GameObjects, and so on), but does not outline parent GameObjects (or their parent GameObjects, and so on).

Selecting the medium ladybug highlights it in orange, and highlights its child GameObject (the small ladybug) in blue, but does not highlight its parent GameObject (the large ladybug).
Selecting the medium ladybug highlights it in orange, and highlights its child GameObject (the small ladybug) in blue, but does not highlight its parent GameObject (the large ladybug).

If selected GameObjects extend beyond the edges of the Scene view, the selection outline runs along the edge of the window:

Selection Wire

启用 Selection Wire 后,在 Scene 视图或 Hierarchy 窗口中选择游戏对象时,将在 Scene 视图中显示该游戏对象的线框网格:

选择颜色

You can set custom colors for selection wireframes.

  1. Go to Unity > Preferences (macOS) or Edit > Preferences (Windows) to open the Preferences editor.
  2. On the colors tab, change one or more of the following colors:
    • (A) Selected Children Outline: outline color for selected GameObjects’ children.
    • (B) Selected Outline: outline color for selected GameObjects.
    • (C) Wireframe Selected: outline color for selected GameObjects’ wireframes.

Built-in components, scripts, and recently changed items

Use the list in the Gizmos menu to control the visibility of icons and gizmos for various components. The list is divided into sections:

The Gizmos menu, displaying items with custom icons and some recently modified items
The Gizmos menu, displaying items with custom icons and some recently modified items

A. The Recently Changed section controls the visibility of the icons and gizmos for items that you’ve modified recently. It appears the first time you change one or more items. Unity updates the list after subsequent changes.

B. The Scripts section controls the visibility of the icons and gizmos for scripts that:

This section appears when your Scene contains one or more scripts that meet the above criteria.

C. The Built-in Components section controls the visibility of the icons and gizmos for all component types that have an icon or gizmo.

Built-in component types that do not have an icon or gizmo shown in the Scene view (for example, Rigidbody) are not listed here.

Toggling icon visibility

The icon column shows or hides the icons for each component type. Full-color icons are displayed in the main Scene view window, faded icons are not.

The Light icon is faded, indicating that the Editor does not display light icons in the Scene view. The Camera icon is full-color, indicating that the Editor does display camera icons in the Scene view.
The Light icon is faded, indicating that the Editor does not display light icons in the Scene view. The Camera icon is full-color, indicating that the Editor does display camera icons in the Scene view.

To toggle an icon’s visibility in the Scene view, click any icon in the icon column.

Note: If an item in the list has a gizmo but no icon, the icon column for that item is empty.

Changing script icons

Scripts with custom icons show a small drop-down menu arrow in the icon column. To change a custom icon, click the arrow to open the Select Icon menu.

Toggling gizmo visibility

To control whether the Editor draws gizmo graphics for a particular component type (for example, a Collider’s wireframe gizmo or a Camera’s view frustum gizmo) or script, use the checkboxes in the Gizmo column.

  • When a checkbox is checked, the Editor draws gizmos for that component type.

  • When a checkbox is cleared, the Editor does not draw gizmos for that component type.

Note: If an item in the list has an icon but no gizmo, the Gizmo column for that item is empty.

To toggle gizmo visibility for an entire section (all Built-in Components, all Scripts, and so on), use the checkboxes next to the section names.

The Built-in Components checkbox toggles gizmo visibility for every type of component listed in that section
The Built-in Components checkbox toggles gizmo visibility for every type of component listed in that section

When the checkbox displays a square, gizmo visibility is toggled on for some item types in the section, and off for others.


  • 2019–03–11 Page amended with limited editorial review

  • Selection outline for child GameObjects added in 2018.3 NewIn20183

  • Gizmo menu option to toggle Gizmo visibility for all components in a section added in 2019.1 NewIn20191

Scene view Camera
Game 视图