Gizmos are used to give visual debugging or setup aids in the Scene view.
All gizmo drawing has to be done in either OnDrawGizmos or
OnDrawGizmosSelected functions of the script.
OnDrawGizmos is called every frame. All gizmos rendered within OnDrawGizmos are pickable.
OnDrawGizmosSelected is called only if the object the script is attached to is selected.
DrawCube | 使用 center 和 size 绘制一个实心盒体。 |
DrawFrustum | 绘制一个摄像机视锥体,并且将当前设置的 Gizmos.matrix 用于其位置和旋转。 |
DrawGUITexture | Draw a texture in the Scene. |
DrawIcon | Draw an icon at a position in the Scene view. |
DrawLine | 绘制一条从 from 开始到 to 的线。 |
DrawMesh | 绘制一个网格。 |
DrawRay | 绘制一条从 from 开始到 from + direction 的射线。 |
DrawSphere | 使用 center 和 radius 绘制一个实心球体。 |
DrawWireCube | 使用 center 和 size 绘制一个线框盒体。 |
DrawWireMesh | 绘制一个线框网格。 |
DrawWireSphere | 使用 center 和 radius 绘制一个线框球体。 |