Scene 视图和 Game 视图都有 Gizmos 菜单。单击 Scene 视图或 Game 视图的工具栏中的 Gizmos 按钮,即可访问 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 视图中显示__图标__。图标是扁平、公告牌式覆盖层,可以用来清楚地指示在处理游戏时游戏对象在游戏中的位置。摄像机图标和光源图标便是内置图标的示例;还可以将您自己的图标分配给游戏对象或各个脚本(请参阅关于分配图标的文档以了解如何执行此操作)。
Show Grid 功能可在场景平面上启用网格。以下图像显示了网格在 Scene 视图中的显示情况:
要更改网格的颜色,请选择 Unity > Preferences > Colors__,然后更改 Grid__ 设置。在此图像中,Scene 视图网格为深蓝色,因此在浅色地板上更显眼:
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).
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).
If selected GameObjects extend beyond the edges of the Scene view, the selection outline runs along the edge of the window:
启用 Selection Wire 后,在 Scene 视图或 Hierarchy 窗口中选择游戏对象时,将在 Scene 视图中显示该游戏对象的线框网格:
You can set custom colors for selection wireframes.
Use the list in the Gizmos menu to control the visibility of icons and gizmos for various components. The list is divided into sections:
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:
Have an icon assigned to them (see documentation on Assigning icons).
Implement the OnDrawGizmos function.
Implement the OnDrawGizmosSelected function.
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.
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.
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.
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.
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.
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