Handles
- ArrowCap
- BeginGUI
- Button
- CircleCap
- ClearCamera
- color
- ConeCap
- CubeCap
- currentCamera
- CylinderCap
- Disc
- DotCap
- DrawAAPolyLine
- DrawBezier
- DrawCamera
- DrawCapFunction
- DrawLine
- DrawPolyLine
- DrawSolidArc
- DrawSolidDisc
- DrawSolidRectangleWithOutline
- DrawWireArc
- DrawWireDisc
- EndGUI
- FreeMoveHandle
- FreeRotateHandle
- Label
- lighting
- matrix
- PositionHandle
- RadiusHandle
- RectangleCap
- RotationHandle
- ScaleHandle
- ScaleSlider
- ScaleValueHandle
- SetCamera
- Slider2D
- Slider
- SnapValue
- SphereCap
Handles.Disc 圆形
static function Disc (rotation : Quaternion, position : Vector3, axis : Vector3, size : float, cutoffPlane : bool, snap : float) : Quaternion
Parameters参数
- positionThe position of disc. //disc的位置
-
rotationThe rotation of disc. //disc的旋转
- axisthe axis to rotate around // 旋转围绕的轴
-
sizethe size of the disc in world space See Also:HandleUtility.GetHandleSize
在世界空间disc的大小 - cutoffPlaneif true, only the front-facing half of the circle is draw / draggable. This is useful when you have many overlapping rotation axes (like in the default rotate tool) to avoid clutter. Note: Use HandleUtility.GetHandleSize where you might want to have constant screen-sized handles.
如果为真,只有圆的前面一半可以被绘制/可拖动,这通常用于当你有许多重叠的旋转轴(就像默认的选择工具)以避免混乱。注意:使用HandleUtility.GetHandleSize你可能希望有恒定屏幕大小的控制柄
Description描述
Make a 3D disc that can be dragged with the mouse
制作一个3D圆形,可以被鼠标拖动。
Disc Handle on the Scene View.
场景视图中的圆形控制柄。
// Create a handle to rotate an object over 45 degrees on X and Y axis
//创建一个控制柄来旋转物体,在x和y轴超过45度
@CustomEditor (DiscValueModifier)
class DiscHandle extends Editor {
function OnSceneGUI () {
target.rot =
Handles.Disc(target.rot,
target.transform.position,
Vector3(1,1,0),
5,
false,
1);
if (GUI.changed)
EditorUtility.SetDirty (target);
}
}
And the script attached to this Handle:
该脚本附加到这个控制柄物体:
// Usage: Place this script on the Game Object you want to modify
// the handle's rot with the disc
//放置这个脚本到你想使用disc修改控制柄的rot的游戏物体
@script ExecuteInEditMode()
var rot : Quaternion = Quaternion.identity;
function Update() {
transform.rotation = rot;
}
最后修改:2011年7月8日 Friday 12:41