计算UIWidget的Bounds

作者:追风剑情 发布于:2016-11-10 20:07 分类:NGUI

  1. public static Bounds GetBounds(UIWidget w)
  2. {
  3. //4个角坐标
  4. Vector3[] corners = w.localCorners;
  5. Bounds b = new Bounds();
  6. b.center = Vector3.Lerp(corners[0], corners[2], 0.5f);
  7. b.size = corners[2] - corners[0];
  8. return b;
  9. }

标签: NGUI

Powered by emlog  蜀ICP备18021003号-1   sitemap

川公网安备 51019002001593号