C# Class RedBlueGames.Tools.DebugUtility

Contains utilities and "Extension methods" to the Debug class, specifically for Drawing
ファイルを表示 Open project: redbluegames/rb-unity-tools

Public Methods

Method Description
DrawArrow ( Vector2 origin, Vector2 endpoint, Color color, float duration = 0.01f ) : void

Draws an arrow using Debug.Draw

DrawBox ( Vector2 worldTopLeft, Vector2 worldBottomRight, Color color, float duration = 0.01f ) : void

Draws a box using Debug.Draw functions

DrawCircle ( Vector2 center, float radius, Color color, float numSegments = 40, float duration = 0.01f ) : void

Draws a Circle using Debug.Draw functions

DrawEdges ( Vector2 worldPoints, Color color, float duration = 0.01f ) : void

Draws an array of edges, where an edge is defined by two Vector2 points, using Debug.Draw

DrawPolygon ( Vector2 worldPoints, Color color, float duration = 0.01f ) : void

Draws a polygon, defined by all verteces of the polygon, using Debug.Draw

Private Methods

Method Description
DebugDrawArrowhead ( Vector2 origin, Vector2 direction, float size, Color color, float duration = 0.01f, float theta = 30.0f ) : void
GetArrowSizeForLine ( Vector2 line ) : float

Method Details

DrawArrow() public static method

Draws an arrow using Debug.Draw
public static DrawArrow ( Vector2 origin, Vector2 endpoint, Color color, float duration = 0.01f ) : void
origin UnityEngine.Vector2 Origin point in world space.
endpoint UnityEngine.Vector2 Endpoint in world space.
color UnityEngine.Color Color for Debug.Draw.
duration float Duration to show the arrow.
return void

DrawBox() public static method

Draws a box using Debug.Draw functions
public static DrawBox ( Vector2 worldTopLeft, Vector2 worldBottomRight, Color color, float duration = 0.01f ) : void
worldTopLeft UnityEngine.Vector2 World top left corner.
worldBottomRight UnityEngine.Vector2 World bottom right corner.
color UnityEngine.Color Color for Debug.Draw.
duration float Duration to show the box.
return void

DrawCircle() public static method

Draws a Circle using Debug.Draw functions
public static DrawCircle ( Vector2 center, float radius, Color color, float numSegments = 40, float duration = 0.01f ) : void
center UnityEngine.Vector2 Center point.
radius float Radius of the circle.
color UnityEngine.Color Color for Debug.Draw.
numSegments float Number of segments for the circle, used for precision of the draw.
duration float Duration to show the circle.
return void

DrawEdges() public static method

Draws an array of edges, where an edge is defined by two Vector2 points, using Debug.Draw
public static DrawEdges ( Vector2 worldPoints, Color color, float duration = 0.01f ) : void
worldPoints UnityEngine.Vector2 World points, defining each vertex of an edge in world space.
color UnityEngine.Color Color for Debug.Draw.
duration float Duration to show the edges.
return void

DrawPolygon() public static method

Draws a polygon, defined by all verteces of the polygon, using Debug.Draw
public static DrawPolygon ( Vector2 worldPoints, Color color, float duration = 0.01f ) : void
worldPoints UnityEngine.Vector2 World points, defining each vertex of the polygon in world space.
color UnityEngine.Color Color for Debug.Draw.
duration float Duration to show the polygon.
return void