Handles.DrawWireArc 绘制弧线

static function DrawWireArc (center : Vector3, normal : Vector3, from : Vector3, angle : float, radius : float) : void

Parameters参数

Description描述

Draw a circular arc in 3D space.

在3D空间绘制一个圆弧。

Handles.DrawWireArc 绘制弧线

Wire 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
//创建一个180度弧线带有ScaleValueHandle附加到圆
//让你可以在WireArcExample.js修改shieldArea变量
@CustomEditor (WireArcExample)
class DrawWireArc extends Editor {
	function OnSceneGUI () {
		Handles.color = Color.red;
		Handles.DrawWireArc(target.transform.position,
			target.transform.up,
			-target.transform.right,
			180,
			target.shieldArea);

		target.shieldArea =
		Handles.ScaleValueHandle(target.shieldArea,
			target.transform.position + target.transform.forward*target.shieldArea,
			target.transform.rotation,
			1,
			Handles.ConeCap,
			1);
	}
}

And the script attached to this Handle:

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

// WireArcExample.js

var shieldArea : float = 5;
Page last updated: 2011-7-9