Class DebugDraw
A system for rendering debug elements in the game view, as well as the scene view.
Options to enable in the editor or in standalone builds can be found in the Atlas
preferences window.
Inheritance
System.Object
UnityEngine.Object
UnityEngine.Component
UnityEngine.Behaviour
UnityEngine.MonoBehaviour
DebugDraw
Namespace: Atlas
Assembly: Atlas.Runtime.dll
Syntax
public sealed class DebugDraw : SingletonBehavior<DebugDraw>
Examples
using UnityEngine;
namespace Atlas.Examples
{
public sealed class Example_DebugDraw : MonoBehaviour
{
private void Update()
{
// Draws a billboarded string of text for 1 frame
DebugDraw.DrawText( Vector3.zero,
"Hi, how are ya?",
Color.cyan,
2f,
AnchorPosition.Center );
}
private void OnDisable()
{
// Draws a billboarded string of text for 3 seconds
DebugDraw.DrawText( Vector3.zero,
"Later, gator",
Color.red,
1f,
3f,
AnchorPosition.TopRight );
}
}
}
Properties
|
Improve this Doc
View Source
IsEnabled
Whether or not the system is enabled
Declaration
public static bool IsEnabled { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Methods
|
Improve this Doc
View Source
DrawCircle(Vector3, Single, Color, Int32)
Declaration
public static void DrawCircle(Vector3 centerPos, float radius, Color color, int numSegments = 16)
Parameters
Type |
Name |
Description |
UnityEngine.Vector3 |
centerPos |
|
System.Single |
radius |
|
UnityEngine.Color |
color |
|
System.Int32 |
numSegments |
|
|
Improve this Doc
View Source
DrawCircle(Vector3, Single, Color, Single, Int32)
Declaration
public static void DrawCircle(Vector3 centerPos, float radius, Color color, float lifetime, int numSegments = 16)
Parameters
Type |
Name |
Description |
UnityEngine.Vector3 |
centerPos |
|
System.Single |
radius |
|
UnityEngine.Color |
color |
|
System.Single |
lifetime |
|
System.Int32 |
numSegments |
|
|
Improve this Doc
View Source
DrawCross(Vector3, Single, Color)
Declaration
public static void DrawCross(Vector3 pos, float lineLength, Color color)
Parameters
Type |
Name |
Description |
UnityEngine.Vector3 |
pos |
|
System.Single |
lineLength |
|
UnityEngine.Color |
color |
|
|
Improve this Doc
View Source
DrawCross(Vector3, Single, Color, Single)
Declaration
public static void DrawCross(Vector3 pos, float lineLength, Color color, float lifetime)
Parameters
Type |
Name |
Description |
UnityEngine.Vector3 |
pos |
|
System.Single |
lineLength |
|
UnityEngine.Color |
color |
|
System.Single |
lifetime |
|
|
Improve this Doc
View Source
DrawLine(Vector3, Vector3, Color)
Declaration
public static void DrawLine(Vector3 startPos, Vector3 endPos, Color color)
Parameters
Type |
Name |
Description |
UnityEngine.Vector3 |
startPos |
|
UnityEngine.Vector3 |
endPos |
|
UnityEngine.Color |
color |
|
|
Improve this Doc
View Source
DrawLine(Vector3, Vector3, Color, Single)
Declaration
public static void DrawLine(Vector3 startPos, Vector3 endPos, Color color, float lifetime)
Parameters
Type |
Name |
Description |
UnityEngine.Vector3 |
startPos |
|
UnityEngine.Vector3 |
endPos |
|
UnityEngine.Color |
color |
|
System.Single |
lifetime |
|
|
Improve this Doc
View Source
DrawRay(Vector3, Vector3, Color)
Declaration
public static void DrawRay(Vector3 pos, Vector3 dir, Color color)
Parameters
Type |
Name |
Description |
UnityEngine.Vector3 |
pos |
|
UnityEngine.Vector3 |
dir |
|
UnityEngine.Color |
color |
|
|
Improve this Doc
View Source
DrawRay(Vector3, Vector3, Color, Single)
Declaration
public static void DrawRay(Vector3 pos, Vector3 dir, Color color, float lifetime)
Parameters
Type |
Name |
Description |
UnityEngine.Vector3 |
pos |
|
UnityEngine.Vector3 |
dir |
|
UnityEngine.Color |
color |
|
System.Single |
lifetime |
|
|
Improve this Doc
View Source
DrawText(Vector3, String, Color, Single, AnchorPosition)
Declaration
public static void DrawText(Vector3 pos, string text, Color color, float fontSize, AnchorPosition anchor = AnchorPosition.TopLeft)
Parameters
Type |
Name |
Description |
UnityEngine.Vector3 |
pos |
|
System.String |
text |
|
UnityEngine.Color |
color |
|
System.Single |
fontSize |
|
AnchorPosition |
anchor |
|
|
Improve this Doc
View Source
DrawText(Vector3, String, Color, Single, Single, AnchorPosition)
Declaration
public static void DrawText(Vector3 pos, string text, Color color, float fontSize, float lifetime, AnchorPosition anchor = AnchorPosition.TopLeft)
Parameters
Type |
Name |
Description |
UnityEngine.Vector3 |
pos |
|
System.String |
text |
|
UnityEngine.Color |
color |
|
System.Single |
fontSize |
|
System.Single |
lifetime |
|
AnchorPosition |
anchor |
|
|
Improve this Doc
View Source
DrawText(Vector3, Quaternion, String, Color, Single, AnchorPosition)
Declaration
public static void DrawText(Vector3 pos, Quaternion rotation, string text, Color color, float fontSize, AnchorPosition anchor = AnchorPosition.TopLeft)
Parameters
Type |
Name |
Description |
UnityEngine.Vector3 |
pos |
|
UnityEngine.Quaternion |
rotation |
|
System.String |
text |
|
UnityEngine.Color |
color |
|
System.Single |
fontSize |
|
AnchorPosition |
anchor |
|
|
Improve this Doc
View Source
DrawText(Vector3, Quaternion, String, Color, Single, Single, AnchorPosition)
Declaration
public static void DrawText(Vector3 pos, Quaternion rotation, string text, Color color, float fontSize, float lifetime, AnchorPosition anchor = AnchorPosition.TopLeft)
Parameters
Type |
Name |
Description |
UnityEngine.Vector3 |
pos |
|
UnityEngine.Quaternion |
rotation |
|
System.String |
text |
|
UnityEngine.Color |
color |
|
System.Single |
fontSize |
|
System.Single |
lifetime |
|
AnchorPosition |
anchor |
|