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.FreeMoveHandle 自由移动控制柄
static function FreeMoveHandle (position : Vector3, rotation : Quaternion, size : float, snap : Vector3, capFunc : DrawCapFunction) : Vector3
Parameters参数
- positionCenter of the handle in 3D space
在3D空间,控制柄的中心 -
rotationOrientation of the handle // 控制柄的方向
-
sizeThe size of the handle. Note: Use HandleUtility.GetHandleSize where you might want to have constant screen-sized handles.
控制柄的大小。注意,使用HandleUtility.GetHandleSize你可能希望有恒定的屏幕大小的控制柄。 - capFuncthe function to use for drawing the handle e.g. Handles.RectangleCap Note: Use HandleUtility.GetHandleSize where you might want to have constant screen-sized handles.
该函数用于绘制控制柄。例如Handles.RectangleCap。注意,使用HandleUtility.GetHandleSize你可能希望有恒定的屏幕大小的控制柄。
Description描述
Make an unconstrained movement handle.
制作一个不受约束的移动控制柄。
This can move freely in all directions. Hold down CMD to snap, CMD-SHIFT to raysnap agains colliders in the scene.
这个可以在所有方向自由移动。在场景,按住CMD以捕捉,CMD-SHIFT再次跟踪捕捉碰撞器
Free Move handle on the Scene View.
在场景视图中的自由移动控制柄。
// Create a simple move handle (Twice as big) on the
// target object that lets you freely move the Object
// Without having the "Move" button selected
//在target物体,创建一个简单的移动控制柄,让你自由移动物体,不必选择Move按钮
@CustomEditor (FreeMove)
class FreeMoveHandleJS extends Editor {
function OnSceneGUI () {
target.pos = Handles.FreeMoveHandle(target.pos,
Quaternion.identity,
2.0,
Vector3.zero,
Handles.DrawRectangle);
if (GUI.changed)
EditorUtility.SetDirty (target);
}
}
And the script attached to this Handle:
该脚本附加到这个控制柄物体:
@script ExecuteInEditMode()
var pos : Vector3 = Vector3(0,0,0);
function Update () {
transform.position = pos;
}
最后修改:2011年7月7日 Thursday 18:58