Skip to main content

GizmosExtension

A static class in Root.Township, the global namespace.

Static helpers that draw shapes with Unity Gizmos, for use inside OnDrawGizmos. Each overload with a colour restores the previous gizmo colour.

Methods​

MemberWhat it is
static void DrawArrow(Vector3 position, Vector3 direction, Color color)Draws a ray with a small cone at its tip.
static void DrawArrow(Vector3 position, Vector3 direction)Draws a ray with a small cone at its tip.
static void DrawArrowTo(Vector3 from, Vector3 to)Draws a line from one point to another with a cone at the end.
static void DrawArrowTo(Vector3 from, Vector3 to, Color color)Draws a line from one point to another with a cone at the end.
static void DrawBounds(Bounds bounds, Color color)Draws the edges of a bounds box.
static void DrawBounds(Bounds bounds)Draws the edges of a bounds box.
static void DrawCapsule(Vector3 start, Vector3 end, Color color, float radius = 1)Draws a wire capsule between two points.
static void DrawCapsule(Vector3 start, Vector3 end, float radius = 1)Draws a wire capsule between two points.
static void DrawCircle(Vector3 position, Vector3 up, Color color, float radius = 1)Draws a circle around a position, facing an up direction (world up by default).
static void DrawCircle(Vector3 position, Color color, float radius = 1)Draws a circle around a position, facing an up direction (world up by default).
static void DrawCircle(Vector3 position, Vector3 up, float radius = 1)Draws a circle around a position, facing an up direction (world up by default).
static void DrawCircle(Vector3 position, float radius = 1)Draws a circle around a position, facing an up direction (world up by default).
static void DrawCone(Vector3 position, Vector3 direction, Color color, float angle = 45)Draws a cone from a position along a direction with the given half angle (world up by default).
static void DrawCone(Vector3 position, Vector3 direction, float angle = 45)Draws a cone from a position along a direction with the given half angle (world up by default).
static void DrawCone(Vector3 position, Color color, float angle = 45)Draws a cone from a position along a direction with the given half angle (world up by default).
static void DrawCone(Vector3 position, float angle = 45)Draws a cone from a position along a direction with the given half angle (world up by default).
static void DrawCylinder(Vector3 start, Vector3 end, Color color, float radius = 1)Draws a wire cylinder between two points.
static void DrawCylinder(Vector3 start, Vector3 end, float radius = 1)Draws a wire cylinder between two points.
static void DrawLocalCube(Transform transform, Vector3 size, Color color, Vector3 center = null)Draws a box in a transform's or matrix's local space.
static void DrawLocalCube(Transform transform, Vector3 size, Vector3 center = null)Draws a box in a transform's or matrix's local space.
static void DrawLocalCube(Matrix4x4 space, Vector3 size, Color color, Vector3 center = null)Draws a box in a transform's or matrix's local space.
static void DrawLocalCube(Matrix4x4 space, Vector3 size, Vector3 center = null)Draws a box in a transform's or matrix's local space.
static void DrawPoint(Vector3 position, Color color, float scale = 1)Draws three crossed lines at a position.
static void DrawPoint(Vector3 position, float scale = 1)Draws three crossed lines at a position.