示例#1
0
 public bool IntersectsWithRectangle(IRectangle aRectangle)
 {
     return(GetX() + GetWidth() >= aRectangle.GetX() &&
            GetX() <= aRectangle.GetX() + aRectangle.GetWidth() &&
            GetY() + GetHeight() >= aRectangle.GetY() &&
            GetY() <= aRectangle.GetY() + aRectangle.GetHeight());
 }
示例#2
0
 public bool IntersectsWithRectangle(IRectangle aRectangle)
 {
     return(aRectangle.GetWidth() > 0 && aRectangle.GetHeight() > 0 && this.width > 0 && this.height > 0 && aRectangle.GetX() < this.x + this.width &&
            aRectangle.GetX() + aRectangle.GetWidth() > this.x && aRectangle.GetY() < this.y + this.height && aRectangle.GetY() + aRectangle.GetHeight() > this.y);
 }
 private void DrawRectangle(IRectangle aRectangle)
 {
     UnityEditor.Handles.DrawPolyLine(new Vector3(aRectangle.GetX(), aRectangle.GetY()),
                                      new Vector3(aRectangle.GetX(), aRectangle.GetY() + aRectangle.GetHeight()),
                                      new Vector3(aRectangle.GetX() + aRectangle.GetWidth(), aRectangle.GetY() + aRectangle.GetHeight()),
                                      new Vector3(aRectangle.GetX() + aRectangle.GetWidth(), aRectangle.GetY()), new Vector3(aRectangle.GetX(), aRectangle.GetY()));
 }