예제 #1
0
 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)
         );
 }
예제 #2
0
		public bool Contains(RectEx r)
		{
			return this.Contains(r.X, r.Y, r.Width, r.Height);
		}
예제 #3
0
 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)
     );
 }
예제 #4
0
		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;
		}
예제 #5
0
 public bool Contains(RectEx r)
 {
     return(this.Contains(r.X, r.Y, r.Width, r.Height));
 }