Пример #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);
 }