Class DebugDraw
Additions to Unity's useful debugging utililies like Debug.DrawRay and Debug.DrawLine. These are particularly useful for AR/VR applications where the debug output needs to be seen in the Game View (not just scene view.)
All parameters duration
will default to a single frame when left at 0,
otherwise duration is in seconds.
Namespace: Global
Assembly: Assembly-CSharp.dll
Syntax
public static class DebugDraw
Methods
Axes(Matrix4x4, float, float, float)
Draw a set of axes corresponding to a Matrix4x4 basis. Uses standard RGB->XYZ coloring.
Declaration
public static void Axes(Matrix4x4 basis, float size = 0.1, float duration = 0, float thickness = 0.001)
Parameters
Type | Name | Description |
---|---|---|
Matrix4x4 | basis | |
float | size | |
float | duration | |
float | thickness |
Bounds(Bounds, Color, float, float)
Draw a bounds outline mesh
Declaration
public static void Bounds(Bounds bounds, Color color, float duration = 0, float thickness = 0.001)
Parameters
Type | Name | Description |
---|---|---|
Bounds | bounds | |
Color | color | |
float | duration | |
float | thickness |
Bounds(Bounds, Color, Matrix4x4, float, float)
Additions to Unity's useful debugging utililies like Debug.DrawRay and Debug.DrawLine. These are particularly useful for AR/VR applications where the debug output needs to be seen in the Game View (not just scene view.)
All parameters duration
will default to a single frame when left at 0,
otherwise duration is in seconds.
Declaration
public static void Bounds(Bounds bounds, Color color, Matrix4x4 boundsTransform, float duration = 0, float thickness = 0.001)
Parameters
Type | Name | Description |
---|---|---|
Bounds | bounds | |
Color | color | |
Matrix4x4 | boundsTransform | |
float | duration | |
float | thickness |
Circle(Vector3, float, Vector3, Color, float)
Draw a circular mesh
Declaration
public static void Circle(Vector3 center, float radius, Vector3 normal, Color color, float duration = 0)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | center | |
float | radius | |
Vector3 | normal | |
Color | color | |
float | duration |
Line(Vector3, Vector3, Color, float, float)
Draw a line as an in-game-rendered cylinder
Declaration
public static void Line(Vector3 start, Vector3 end, Color color, float duration = 0, float thickness = 0.001)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | start | |
Vector3 | end | |
Color | color | |
float | duration | |
float | thickness |
Point(Vector3, float, Color, float)
Additions to Unity's useful debugging utililies like Debug.DrawRay and Debug.DrawLine. These are particularly useful for AR/VR applications where the debug output needs to be seen in the Game View (not just scene view.)
All parameters duration
will default to a single frame when left at 0,
otherwise duration is in seconds.
Declaration
public static void Point(Vector3 center, float radius, Color color, float duration = 0)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | center | |
float | radius | |
Color | color | |
float | duration |
Ray(Vector3, Vector3, Color, float, float)
Draw a ray as an in-game-rendered cylinder
Declaration
public static void Ray(Vector3 start, Vector3 direction, Color color, float duration = 0, float thickness = 0.001)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | start | |
Vector3 | direction | |
Color | color | |
float | duration | |
float | thickness |
Sphere(Vector3, float, Color, float)
Draw a sphere/point mesh
Declaration
public static void Sphere(Vector3 center, float radius, Color color, float duration = 0)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | center | |
float | radius | |
Color | color | |
float | duration |
Text(Vector3, string, Color, float)
Draw some text to the screen at a specified position
Declaration
public static void Text(Vector3 position, string text, Color color, float duration = 0)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | |
string | text | |
Color | color | |
float | duration |
Remarks
Note
The Text(Vector3, string, Color, float) method only works in the Unity Editor and only displays in scene view.