BoxColliderUtilities

developed November 2010

Update(22.02.2013)

It seems that since Unity3.4 a similar function is already built into Unity. Just hold down "Shift" when you select a primitive collider (Sphere, Box, Capsule). This will show small green handles at the center of each face which can be dragged.

Description
Allows you to scale or rotate a BoxCollider side-aligned

This script extends the Unity editor when editing a BoxCollider. Depending on the transformation mode it shows 6 additional handles in the scene-view. In scaling mode you can extend or reduce the box at one end. In other words the box doesn't scale around the center pivot. The GOs center is adjusted to keep the opposite side where it is. In rotation mode it's quite similar. You can rotate the box around one of it's 6 side-centers.

This can be useful when placing triggers or colliders in the scene.

(I've also planned to rotate around the box corners but no time atm ;))

Usage
You must place the script in a folder named Editor in your project's Assets folder for it to work properly.

To use the additional scaling/rotating: select a GameObject with a BoxCollider-component attached and choose the transformation mode in the BoxCollider inspector. To hide the Unity default handle just switch to the camera mode (hotkey Q)

watch out: Don't try to scale a Box that is nested in a GO which is already scaled. This script works only when the local scale is equal to the global scale. So nesting is possible, but all parents need to have all scaling factors set to 1. Parent rotation or movement will work without problems.