Is there really no way to view all colliders in the editor?

I’m working in 2D with a bunch of sprites that all have their own box colliders. I need to make sure that they’re all lined up properly, but this is proving much more difficult than it should be. Is there really no way to have all unselected colliders visible while editing a single collider?

The only real solution I have found while searching is to either parent everything to a gameobject (which lets me view them all at once when I select that object, but once I click on a single collider to edit, the rest go invisible again). Or to shift select multiple items in the hierarchy (which causes the same problem if I only want to edit one of them).

People have suggested using Gizmos, but I can’t find anything in the documentation about rendering colliders. Isn’t there a way to show all of the colliders in the Editor while I’m working?

Thanks!

Edit: I found a slight workaround. Although it doesn’t completely alleviate the problem, it does make it a bit more manageable. If you have multiple objects selected and hold down Shift, you can edit their collision points individually. Might not be as elegant as editing with the Inspector, but it will still make the job a lot less painful!

Hi,
just add a C# Script “DrawWireColliders” to the game object containing the collider and paste the code below to draw the box collider inside the editor. This works for BoxCollider and SphereCollider only.

using UnityEngine;
using System.Collections;
using System;

public class DrawWireColliders : MonoBehaviour {

void OnDrawGizmos() {

BoxCollider bCol = GetComponent();
SphereCollider sCol = GetComponent();

Gizmos.color = Color.red;

if(bCol != null)
{
Gizmos.DrawWireCube(bCol.bounds.center, bCol.bounds.size);
}

if(sCol != null)
{
float maxScale = Math.Max(gameObject.transform.localScale.x,
Math.Max(gameObject.transform.localScale.y, gameObject.transform.localScale.z));

Gizmos.DrawWireSphere(sCol.bounds.center, sCol.radius * maxScale);
}

}

}