Handles.DrawSolidArc 绘制实心弧

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

Parameters参数

Description描述

Draw a circular sector (pie piece) in 3D space.

在3D空间绘制一个圆扇形。

Handles.DrawSolidArc 绘制实心弧

Solid 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 (SolidArcExample)
class DrawSolidArc extends Editor {
	function OnSceneGUI () {
		Handles.color = Color(1,1,1,0.2);
		Handles.DrawSolidArc(target.transform.position,
		target.transform.up,
		-target.transform.right,
		180,
		target.shieldArea);
		Handles.color = Color.white;
		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:

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

// SolidArcExample.js

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