center | 圆盘的中心。 |
normal | 圆盘的法线。 |
radius | 圆盘的半径。 注意:如果您希望拥有恒定屏幕大小的手柄,请使用 HandleUtility.GetHandleSize。 |
在 3D 空间中绘制一个平面圆盘的轮廓。
Wire Disc in the Scene View.
// Create a wire disc with a ScaleValueHandle attached to the disc // that lets you drag the "areaOfEffect" var in the WireDiscExample.js
@CustomEditor (WireDiscExample) class DrawWireDisc extends Editor { function OnSceneGUI () { Handles.color = Color.red; Handles.DrawWireDisc(target.transform.position, Vector3.up, target.areaOfEffect);
target.areaOfEffect = Handles.ScaleValueHandle(target.areaOfEffect, target.transform.position + Vector3(target.areaOfEffect,0,0), Quaternion.identity, 2, Handles.CylinderCap, 2); } }
附加到此手柄的脚本:
//WireDiscExample.js
var areaOfEffect : float = 5;