Gizmos 類html
能夠在代碼中繪製一些輸出結果或者中間輸出內容,好比計算後的包圍盒等等測試
方法 | 做用 |
---|---|
color | 控制輸出顏色 |
matrix | Set the gizmo matrix used to draw all gizmos. |
DrawCube | 繪製立方體 |
DrawWireCube | 線框立方體 |
DrawLine | 繪製直線 |
DrawMesh | 繪製Mesh |
DrawWireMesh | 線框Mesh |
DrawRay | 方向射線 |
DrawSphere | |
DrawWireSphere |
All gizmo drawing has to be done in either OnDrawGizmos or OnDrawGizmosSelected functions of the script.3d
固然結果只能在Scene視圖中查看
code
好比咱們要繪製一個輸出的包圍盒htm
private Bounds needDraw ; void OnDrawGizmos() { Gizmos.color = new Color(1, 0, 1, 0.5F); Gizmos.DrawWireCube(needDraw.center, needDraw.size); }