Getting Started
Installation
To install, download the latest version from the Unit Asset Store, or from the releases page.
Usage
First import the DebugDraw namespace.
using C.DebugDraw;
All draw commands are accessed through the static Draw class.
Visuals are wireframe by default, but some also provide Solid or filled variants,
e.g. Circle and SolidCircle.
void Update() {
// Draws a line between `p1` and `p2` using the default color.
Draw.Line(p1, p2);
}
Overloads
Most draw commands provide overloads for common parameters, such as size or color, and duration.
// Draws a yellow line that lasts 1 and a half seconds.
Draw.Line(p1, p2, Color.yellow, expiry: 1.5f);
Property setters can also be chained to set less common parameters.
Draw.Arrow(p1, p2)
// Set the start and end colors.
.Color(clr1, clr2)
// Make the arrowhead orients itself along the Y axis.
Facing(new float3(0, 1, 0))
// Set the size and shape of the arrowhead.
.HeadSize(2, 1)
.HeadShape(ArrowHeadShape.Closed);
Defaults/Settings
Configuration is also done through the Draw class, and can changed at any time.
void Awake() {
// Sets the default color for all visuals.
Draw.Color.SetValue(Color.white);
// Sets the opacity for all lines to 50%.
Draw.LineOpacity = 0.5f;
}