Description

A collection of components and editor scripts that allow the level designer to see the 2D collider of any object at any time, a feature not natively available in Unity

Features

  • Always show 2D collider, even when the object is not selected (disable when you want)
  • Support rotating and scaling the object or a parent
  • Customize the color of the collider lines
  • For Edge and Polygon 2D colliders, edit points directly by coordinates (this feature is now native since Unity 5.4)
  • Inspector button to Round all coordinates to 1/16 px
  • Also works in 3D view (displays the 2D colliders in perspective)

Screenshots

EditBoxCollider2D component in Unity Inspector Unity scene in 2D mode with collider view enabled Unity scene in 3D mode with collider view enabled EditEdgeCollider2D component allows to edit coordinates and always view the edge
The "Round all coordinates to 1/16 px" button was added after those screenshots were taken

Source code

The link above targets the parent directory of the scripts. The individual scripts are:

The scripts depend on GizmosUtil, a helper script I mainly wrote to support the 2D collider debug view.

Credits

The editing part is based on Raphael Marques’ answer on Stackoverflow.