예제 #1
0
 public static Vector2 NormalizedToPoint(RectInt rectangle, Vector2 normalizedRectCoordinates)
 {
     return(new Vector2(Mathf.Lerp(rectangle.x, rectangle.xMax, normalizedRectCoordinates.x),
                        Mathf.Lerp(rectangle.y, rectangle.yMax, normalizedRectCoordinates.y)));
 }
예제 #2
0
 public static Vector2 PointToNormalized(RectInt rectangle, Vector2 point)
 {
     return(new Vector2(Mathf.InverseLerp(rectangle.x, rectangle.xMax, point.x),
                        Mathf.InverseLerp(rectangle.y, rectangle.yMax, point.y)));
 }
예제 #3
0
 public bool Overlaps(RectInt other)
 {
     return(other.xMax > xMin && other.xMin < xMax && other.yMax > yMin && other.yMin < yMax);
 }