Version: 2022.3

Gizmos

class in UnityEngine

切换到手册

描述

辅助图标用于协助在 Scene 视图中进行视觉调试或设置。

All gizmo drawing has to be done in either MonoBehaviour.OnDrawGizmos or MonoBehaviour.OnDrawGizmosSelected functions of the script. MonoBehaviour.OnDrawGizmos is called when the Scene view or Game view is repainted. All gizmos that render in MonoBehaviour.OnDrawGizmos are pickable. MonoBehaviour.OnDrawGizmosSelected is called only if the object the script is attached to is selected.

静态变量

colorSets the Color of the gizmos that are drawn next.
exposure设置包含 LightProbe 辅助图标的曝光校正的纹理。值从纹理中间的红色通道进行采样。
matrix设置 Unity Editor 用于绘制 Gizmos 的 Matrix4x4。
probeSizeSet a scale for Light Probe gizmos. This scale will be used to render the spherical harmonic preview spheres.

静态函数

DrawCubeDraw a solid box at center with size.
DrawFrustumDraw a camera frustum using the currently set Gizmos.matrix for its location and rotation.
DrawGUITexture在该场景中绘制一个纹理。
DrawIcon在 Scene 视图中的某个位置绘制一个图标。
DrawLine绘制一条从 from 开始到 to 的线。
DrawLineListDraws multiple lines between pairs of points.
DrawLineStripDraws a line between each point in the supplied span.
DrawMesh绘制一个网格。
DrawRay绘制一条从 from 开始到 from + direction 的射线。
DrawSphere使用 center 和 radius 绘制一个实心球体。
DrawWireCube使用 center 和 size 绘制一个线框盒体。
DrawWireMesh绘制一个线框网格。
DrawWireSphere使用 center 和 radius 绘制一个线框球体。