public void DrawRectGizmo(RectEx rc) { Gizmos.DrawLine( new Vector3(rc.X, 10, rc.Y), new Vector3(rc.X, 10, rc.Y + rc.H) ); Gizmos.DrawLine( new Vector3(rc.X, 10, rc.Y + rc.H), new Vector3(rc.X + rc.W, 10, rc.Y + rc.H) ); Gizmos.DrawLine( new Vector3(rc.X + rc.W, 10, rc.Y + rc.H), new Vector3(rc.X + rc.W, 10, rc.Y) ); Gizmos.DrawLine( new Vector3(rc.X + rc.W, 10, rc.Y), new Vector3(rc.X, 10, rc.Y) ); }
public bool Contains(RectEx r) { return this.Contains(r.X, r.Y, r.Width, r.Height); }
public Transform2D(Transform target) { var bounds = NGUIMath.CalculateRelativeWidgetBounds(target, true); var rc = new RectEx( bounds.center.x - bounds.extents.x, bounds.center.y - bounds.extents.y, bounds.size.x, bounds.size.y); this.Size = new Vector2(rc.W, rc.H); var s = this.Size; var p = target.localPosition; p.x -= s.x * 0.5f; p.y += s.y * 0.5f; this.Pos = p; }
public bool Contains(RectEx r) { return(this.Contains(r.X, r.Y, r.Width, r.Height)); }