I wanted to use NGUI's touch messaging, so I had to do this. it wasn't bad.
all of the changes are in UICamera. Change all of the Physics to Physics2D and the RaycastHit to RaycastHit2D.
finally the 2d raycast cannot provide an "out" ray as an argument like the 3d raycast, and it does not return a bool, so there is a slight logic change...
what used to look like:
if ((Physics.Raycast (ray, out hit, dist, mask))
now looks like:
hit = Physics2D.Raycast (ray.origin, ray.direction, dist, mask);
if (hit.collider != null)
(don't forget you have to change all of the RaycastHit to RaycastHit2D and Physics to Physics2D, so that hit is actually a RaycastHit2D).
there is also a similar change with the whole:
RaycastHit[] hits = Physics.RaycastAll(...
becoming:
RaycastHit2D[] hits = Physics2D.RaycastAll(ray.origin, ray.direction, ...
these changes basically make NGUI only detect hits with 2d colliders and not with 3d colliders. I plan on making my UI widgets, then manually changing the rigidbody to rigidbody2d and the collider to collider2d on all of the panels and widgets.