Legacy Documentation: Version 5.0
Language: English
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

Handles.DrawWireArc

Switch to Manual
public static function DrawWireArc(center: Vector3, normal: Vector3, from: Vector3, angle: float, radius: float): void;

Parameters

centerThe center of the circle.
normalThe normal of the circle.
fromThe direction of the point on the circle circumference, relative to the center, where the arc begins.
angleThe angle of the arc, in degrees.
radiusThe radius of the circle

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

Description

Draw a circular arc in 3D space.


Wire Arc in the Scene View.

#pragma strict
//this class should exist somewhere in your project
public class WireArcExample {
	public var shieldArea;
	// ...other code...
}
// Create a 180 degrees wire arc with a ScaleValueHandle attached to the disc
// that lets you modify the "shieldArea" var in the WireArcExample.js
@CustomEditor(WireArcExample)
public class DrawWireArc extends Editor {
	function OnSceneGUI() {
		Handles.color = Color.red;
		var myObj = WireArcExampletarget;
		Handles.DrawWireArc(myObj.transform.position, myObj.transform.up, -myObj.transform.right, 180, myObj.shieldArea);
		myObj.shieldArea = floatHandles.ScaleValueHandle(myObj.shieldArea, myObj.transform.position + myObj.transform.forward * myObj.shieldArea, myObj.transform.rotation, 1, Handles.ConeCap, 1);
	}
}

And the script attached to this Handle:

	// WireArcExample.js
	
	var shieldArea : float = 5;