Struct CommandBuilder Extends IDisposable

Public

Builder for drawing commands.

You can use this to queue many drawing commands. The commands will be queued for rendering when you call the Dispose method. It is recommended that you use the using statement which automatically calls the Dispose method.

// Create a new CommandBuilder
using (var draw = DrawingManager.GetBuilder()) {
// Use the exact same API as the global Draw class
draw.WireBox(Vector3.zero, Vector3.one);
}

Warning

You must call either Dispose or DiscardAndDispose when you are done with this object to avoid memory leaks.

Inner Types

Holds rendering data for a box.

Holds rendering data for a circle.

Holds rendering data for a circle.

Holds rendering data for a line.

Helper for drawing a polyline with symbols at regular intervals.

Scope that does nothing.

Holds rendering data for a sphere.

Public Methods

AddText (text)
Arc (center, start, end, [color])

Arrow (from, to, [up, headSize], [color])

ArrowRelativeSizeHead (from, to, up, headFraction, [color])

Arrowhead (center, direction, [up], radius, [color])

...

ArrowheadArc (origin, direction, offset, [width], [color])

Bezier (p0, p1, p2, p3, [color])

...

CatmullRom (..., [color])

Circle (center, normal, radius, [color])

CircleXY (center, radius, [...])

CircleXZ (center, radius, [...])

Cross (position, [size], [color])

CrossXY (position, [size], [color])

CrossXZ (position, [size], [color])

DashedLine (a, b, dash, gap, [color])

DashedPolyline (points, dash, gap, [color])

Discards the contents of this command builder without rendering anything.

Dispose ()

Submits this command builder for rendering.

DisposeAfter (dependency, allowedDelay=…)

Disposes this command builder after the given job has completed.

InLocalSpace (transform)

Scope to draw multiple things relative to a transform object.

InScreenSpace (camera)

Scope to draw multiple things in screen space of a camera.

Label2D (position, text, [...])

...

Label3D (position, rotation, text, ..., size, ...)

Line (a, b, [color])

PlaneWithNormal (center, ..., size, [color])

Polyline (points, [cycle], [color])

Pops a color from the stack.

Pops a duration scope from the stack.

Pops a line width scope from the stack.

Pops a matrix from the stack.

Preallocate (size)

Pre-allocates the internal buffer to an additional size bytes.

PushColor (color)

Draws everything until the next PopColor with the given color.

PushDuration (duration)

Draws everything until the next PopDuration for a number of seconds.

PushLineWidth (pixels, automaticJoins=true)

Draws all lines until the next PopLineWidth with a given line width in pixels.

PushMatrix (matrix)

Multiply all coordinates until the next PopMatrix with the given matrix.

PushSetMatrix (matrix)

Multiply all coordinates until the next PopMatrix with the given matrix.

Ray (..., [color])

...

SolidArc (center, start, end, [color])

SolidBox (..., [color])

...

SolidCircle (center, normal, radius, [color])

...

SolidCircleXY (center, radius, [...])

SolidCircleXZ (center, radius, [...])

SolidMesh (...)

...

SolidMeshInternal (mesh, temporary, [color])
SolidPlane (center, ..., size, [color])

...

SolidRectangle (rect, [color])

SolidTriangle (a, b, c, [color])

...

SphereOutline (center, radius, [color])

WireBox (..., [color])

WireCapsule (..., radius, [color])

WireCylinder (..., radius, [color])

WireGrid (center, rotation, cells, totalSize, [color])

WireHexagon (center, rotation, radius, [color])

WireMesh (..., [color])

WirePentagon (center, rotation, radius, [color])

WirePlane (center, ..., size, [color])

WirePolygon (center, vertices, rotation, radius, [color])

WireRectangle (..., [color])

WireRectangleXZ (center, size, [color])

WireSphere (position, radius, [color])

WireTriangle (..., [color])

WithColor (color)

Scope to draw multiple things with the same color.

WithDuration (duration)

Scope to draw multiple things for a longer period of time.

WithLineWidth (pixels, automaticJoins=true)

Scope to draw multiple things with a given line width.

WithMatrix (matrix)

Scope to draw multiple things with an implicit matrix transformation.

Public Static Methods

EvaluateCubicBezier (p0, p1, p2, p3, t)

Returns a point on a cubic bezier curve.

OrthonormalBasis (normal, basis1, basis2)

Constructs an orthonormal basis from a single normal vector.

Public Variables

cameraTargets

Can be set to render specifically to these cameras.

Public
xy

Wrapper for drawing in the XY plane.

Public
xz

Wrapper for drawing in the XZ plane.

Public

Public Static Variables

DEFAULT_UP
Public Static Readonly

Public Enums

SymbolDecoration

Determines the symbol to use for PolylineWithSymbol.

Public

Private/Protected Members

Add<T> (value)
BufferSize
Internal
CircleXZInternal (center, radius, [...])
Command

Internal rendering command.

Internal
CommandBuilder (..., gizmos, ...)
ConvertColor (color)

Converts a Color to a Color32.

Reserve ([...])

SolidCircleXZInternal (center, radius, [...])
XZtoXYPlaneMatrix
Internal Static Readonly
XZtoYZPlaneMatrix
Internal Static Readonly
buffer
Internal
calculateTangent (normal)

Returns an arbitrary vector which is orthogonal to the given one.

gizmos
Private
threadIndex
Private
uniqueID
Private

Deprecated Members

Pops a persist scope from the stack.

PushPersist (duration)

Draws everything until the next PopPersist for a number of seconds.