Handles.RadiusHandle 半径控制柄

static function RadiusHandle (rotation : Quaternion, position : Vector3, radius : float, handlesOnly : bool) : float
static function RadiusHandle (rotation : Quaternion, position : Vector3, radius : float) : float

Parameters参数

Returns

float - the modified radius Note: Use HandleUtility.GetHandleSize where you might want to have constant screen-sized handles.

返回浮点值,修改的半径。注意:使用Use HandleUtility.GetHandleSize你可能希望有恒定屏幕大小的控制柄。

Description描述

Make a Scene view radius handle

创建一个场景视图半径控制柄。

This will behave like the built-in scale tool

这行为就像内置的缩放工具。

Handles.RadiusHandle 半径控制柄

RadiusHandle on the Scene View.
场景视图中的半径控制器

// Simple script that draws and controls a float var on any Game Object that has the

// ColliderRadius.js script attached.

//绘制并控制在任意游戏物体上,带有ColliderRadius.js的浮点变量。

@CustomEditor (ColliderRadius)

class RadiusHandleJS extends Editor {

	function OnSceneGUI () {

		target.areaOfEffect = Handles.RadiusHandle (Quaternion.identity,

		target.transform.position,

		target.areaOfEffect);

		if (GUI.changed)

			EditorUtility.SetDirty (target);

	}

}

And the Script attached to this handle:

该脚本附加到这个控制柄物体:

// Place this script where you want to see the RadiusHandler working on.

//放置这个脚本到你想看到半径控制器的物体。



var areaOfEffect : float = 1;
Page last updated: 2011-7-7