Class Draw
A utility class for drawing debug lines, shapes, and bounds for players or globally.
public static class Draw
- Inheritance
-
Draw
- Inherited Members
Methods
Bounds(Bounds, Color, float, IEnumerable<Player>)
Draws the edges of a Bounds(Bounds, Color, float, IEnumerable<Player>) object.
public static void Bounds(Bounds bounds, Color color, float duration, IEnumerable<Player> players = null)
Parameters
boundsBoundsThe Bounds(Bounds, Color, float, IEnumerable<Player>) object to visualize.
colorColorThe color of the lines.
durationfloatHow long the line should remain visible.
Warning: Avoid using PositiveInfinity or extremely large values, as these lines cannot be removed from the client once sent. playersIEnumerable<Player>A collection of Players to show the bounds to.
Box(Vector3, Vector3, Quaternion, Color, float, IEnumerable<Player>)
Draws a box using exact dimensions.
public static void Box(Vector3 center, Vector3 size, Quaternion rotation, Color color, float duration, IEnumerable<Player> players = null)
Parameters
centerVector3The center point of the box.
sizeVector3The size of the box.
rotationQuaternionThe rotation of the box.
colorColorThe color of the lines.
durationfloatHow long the line should remain visible.
Warning: Avoid using PositiveInfinity or extremely large values, as these lines cannot be removed from the client once sent. playersIEnumerable<Player>A collection of Players to show the sphere to.
Capsule(Vector3, Quaternion, float, float, Vector3, Color, float, IEnumerable<Player>)
Draws a wireframe capsule.
public static void Capsule(Vector3 center, Quaternion rotation, float height, float radius, Vector3 scale, Color color, float duration, IEnumerable<Player> players = null)
Parameters
centerVector3The center point of the capsule.
rotationQuaternionThe rotation of the capsule.
heightfloatThe height of the capsule.
radiusfloatThe radius of the capsule.
scaleVector3The scale of the capsule.
colorColorThe color of the lines.
durationfloatHow long the line should remain visible.
Warning: Avoid using PositiveInfinity or extremely large values, as these lines cannot be removed from the client once sent. playersIEnumerable<Player>A collection of Players to show the capsule to.
Circle(Vector3, Quaternion, Vector3, Color, float, IEnumerable<Player>, bool, int)
Draws a circle at a specific position.
public static void Circle(Vector3 origin, Quaternion rotation, Vector3 scale, Color color, float duration, IEnumerable<Player> players = null, bool horizontal = true, int segments = 16)
Parameters
originVector3The center point of the circle.
rotationQuaternionThe rotation of the circle.
scaleVector3The scale of the circle.
colorColorThe color of the lines.
durationfloatHow long the line should remain visible.
Warning: Avoid using PositiveInfinity or extremely large values, as these lines cannot be removed from the client once sent. playersIEnumerable<Player>A collection of Players to show the circle to.
horizontalboolIndicates whether the circle should be drawn on the horizontal plane (XZ) or vertical plane (XY).
segmentsintThe number of line segments used to draw the circle. Higher values result in a smoother circle.
Collider(Collider, Color, float, IEnumerable<Player>)
Draws a collider.
public static void Collider(Collider collider, Color color, float duration, IEnumerable<Player> players = null)
Parameters
colliderColliderThe UnityEngine.BoxCollider object to visualize.
colorColorThe color of the lines.
durationfloatHow long the line should remain visible.
Warning: Avoid using PositiveInfinity or extremely large values, as these lines cannot be removed from the client once sent. playersIEnumerable<Player>A collection of Players to show the bounds to.
Line(Vector3, Vector3, Color, float, IEnumerable<Player>)
Draws a line between two specified points.
public static void Line(Vector3 start, Vector3 end, Color color, float duration, IEnumerable<Player> players = null)
Parameters
startVector3The starting position of the line.
endVector3The ending position of the line.
colorColorThe color of the lines.
durationfloatHow long the line should remain visible.
Warning: Avoid using PositiveInfinity or extremely large values, as these lines cannot be removed from the client once sent. playersIEnumerable<Player>A collection of Players to show the line to.
Mesh(Mesh, Transform, Color, float, IEnumerable<Player>)
Draws a wireframe mesh.
public static void Mesh(Mesh mesh, Transform transform, Color color, float duration, IEnumerable<Player> players = null)
Parameters
meshMeshThe Mesh(Mesh, Transform, Color, float, IEnumerable<Player>) to visualize.
transformTransformThe Transform of the mesh.
colorColorThe color of the lines.
durationfloatHow long the line should remain visible.
Warning: Avoid using PositiveInfinity or extremely large values, as these lines cannot be removed from the client once sent. playersIEnumerable<Player>A collection of Players to show the capsule to.
Path(Vector3[], Color, float, IEnumerable<Player>)
Draws a connected path through a series of points.
public static void Path(Vector3[] points, Color color, float duration, IEnumerable<Player> players = null)
Parameters
pointsVector3[]An array of UnityEngine.Vector3 points to connect sequentially.
colorColorThe color of the lines.
durationfloatHow long the line should remain visible.
Warning: Avoid using PositiveInfinity or extremely large values, as these lines cannot be removed from the client once sent. playersIEnumerable<Player>A collection of Players to show the path to.
RelativeBounds(RelativeBounds, Color, float, IEnumerable<Player>)
Draws the edges of a RelativeBounds(RelativeBounds, Color, float, IEnumerable<Player>) object.
public static void RelativeBounds(RelativeBounds relativeBounds, Color color, float duration, IEnumerable<Player> players = null)
Parameters
relativeBoundsRelativeBoundsThe RelativeBounds(RelativeBounds, Color, float, IEnumerable<Player>) object to visualize.
colorColorThe color of the lines.
durationfloatHow long the line should remain visible.
Warning: Avoid using PositiveInfinity or extremely large values, as these lines cannot be removed from the client once sent. playersIEnumerable<Player>A collection of Players to show the bounds to.
Sphere(Vector3, Quaternion, Vector3, Color, float, IEnumerable<Player>, int)
Draws a wireframe sphere composed of two circles (horizontal and vertical).
public static void Sphere(Vector3 origin, Quaternion rotation, Vector3 scale, Color color, float duration, IEnumerable<Player> players = null, int segments = 16)
Parameters
originVector3The center point of the sphere.
rotationQuaternionThe rotation of the sphere.
scaleVector3The scale of the sphere.
colorColorThe color of the lines.
durationfloatHow long the line should remain visible.
Warning: Avoid using PositiveInfinity or extremely large values, as these lines cannot be removed from the client once sent. playersIEnumerable<Player>A collection of Players to show the sphere to.
segmentsintThe number of segments for the circles. Higher values result in a smoother sphere.