////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2007-2020 , Inc. All Rights Reserved.
//
////////////////////////////////////////////////////////////////////////////////
using UnityEngine;
namespace GCSeries.Core.Extensions
{
public static class RectIntExtensions
{
///
/// Checks whether the other rectangle overlaps this one.
///
///
///
/// The other rectangle to test overlapping with.
///
///
///
/// Returns true if the other rectangle overlaps this one.
///
public static bool Overlaps(this RectInt r, RectInt other)
{
if (other.xMax > r.xMin &&
other.xMin < r.xMax &&
other.yMax > r.yMin)
{
return other.yMin < r.yMax;
}
return false;
}
}
}