鸟语天空
计算UIWidget的Bounds
post by:追风剑情 2016-11-10 20:07
public static Bounds GetBounds(UIWidget w)
{
        //4个角坐标
        Vector3[] corners = w.localCorners;
        Bounds b = new Bounds();
        b.center = Vector3.Lerp(corners[0], corners[2], 0.5f);
        b.size = corners[2] - corners[0];
        return b;
}
评论:
发表评论:
昵称

邮件地址 (选填)

个人主页 (选填)

内容