Rect GetRect()
{
UISprite sp = GetComponent<UISprite> ();
Vector3 pt = sp.transform.TransformPoint (sp.transform.position);
pt = UICamera.currentCamera.WorldToScreenPoint(pt);
//float width = (touchZone.width*NGUITools.screenSize.x)/touchZone.root.manualWidth;
//float height = (touchZone.height*NGUITools.screenSize.y)/touchZone.root.activeHeight;
Bounds bounds = NGUIMath.CalculateRelativeWidgetBounds(UICamera.currentCamera.transform, sp.transform);
float width = bounds.size.x;
float height = bounds.size.y;
Debug.LogError("Button Width:"+ width + " Height: " + height);
Rect rect
= new Rect
(pt
.x - width
/ 2, pt
.y - height
/ 2, width, height
); return rect;
}