辅助图标用于协助在 Scene 视图中进行视觉调试或设置。
所有辅助图标绘图都必须在此脚本的 OnDrawGizmos 或 OnDrawGizmosSelected 函数中进行。\ 每一帧都调用 OnDrawGizmos。在 OnDrawGizmos 中渲染的所有辅助图标均可选择。 仅在选择了附加此脚本的对象时才调用 OnDrawGizmosSelected。
DrawCube | 使用 center 和 size 绘制一个实心盒体。 |
DrawFrustum | 绘制一个摄像机视锥体,并且将当前设置的 Gizmos.matrix 用于其位置和旋转。 |
DrawGUITexture | 在该场景中绘制一个纹理。 |
DrawIcon | 在 Scene 视图中的某个位置绘制一个图标。 |
DrawLine | 绘制一条从 from 开始到 to 的线。 |
DrawMesh | 绘制一个网格。 |
DrawRay | 绘制一条从 from 开始到 from + direction 的射线。 |
DrawSphere | 使用 center 和 radius 绘制一个实心球体。 |
DrawWireCube | 使用 center 和 size 绘制一个线框盒体。 |
DrawWireMesh | 绘制一个线框网格。 |
DrawWireSphere | 使用 center 和 radius 绘制一个线框球体。 |
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.