Rect.Contains Manual     Reference     Scripting  
Scripting > Runtime Classes > Rect
Rect.Contains

function Contains (point : Vector2) : bool

function Contains (point : Vector3) : bool

Description

Returns true if the x and y components of point is a point inside this rectangle.

// prints inside when mouse is in lower left corner
function Update ()
{
var rect = Rect (0, 0, 150, 150);
if (rect.Contains(Input.mousePosition))
print("Inside");
}