Legacy Documentation: Version 4.6(go to latest)
Language: English
  • C#
  • JS
  • Boo

Script language

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

Handles.DrawWireArc

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Sumbission failed

For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

public static function DrawWireArc(center: Vector3, normal: Vector3, from: Vector3, angle: float, radius: float): void;
public static void DrawWireArc(Vector3 center, Vector3 normal, Vector3 from, float angle, float radius);
public static def DrawWireArc(center as Vector3, normal as Vector3, from as Vector3, angle as float, radius as float) as void

Parameters

center The center of the circle.
normal The normal of the circle.
from The direction of the point on the circle circumference, relative to the center, where the arc begins.
angle The angle of the arc, in degrees.
radius The 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.

	// 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)
	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;