center | 圆形的中心。 |
normal | 圆形的法线。 |
from | 圆周上的点相对于圆心的方向,即扇形的起点。 |
angle | 扇形的角度(以度为单位)。 |
radius | 圆形的半径。 注意:如果您希望拥有恒定屏幕大小的手柄,请使用 HandleUtility.GetHandleSize。 |
在 3D 空间中绘制一个圆扇形(饼图)。
Solid Arc in the Scene View.
// Create a 180 degrees wire arc with a ScaleValueHandle attached to the disc
// that lets you modify the "shieldArea" var in the WireArcExample.js
@CustomEditor (SolidArcExample)
class DrawSolidArc extends Editor {
function OnSceneGUI () {
Handles.color = Color(1,1,1,0.2);
Handles.DrawSolidArc(target.transform.position,
target.transform.up,
-target.transform.right,
180,
target.shieldArea);
Handles.color = Color.white;
target.shieldArea =
Handles.ScaleValueHandle(target.shieldArea,
target.transform.position + target.transform.forward*target.shieldArea,
target.transform.rotation,
1,
Handles.ConeCap,
1);
}
}
附加到此手柄的脚本:
// SolidArcExample.js
var shieldArea : float = 5;