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");
}
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
void Update() {
Rect rect = new Rect(0, 0, 150, 150);
if (rect.Contains(Input.mousePosition))
print("Inside");
}
}
import UnityEngine
import System.Collections
class example(MonoBehaviour):
def Update():
rect as Rect = Rect(0, 0, 150, 150)
if rect.Contains(Input.mousePosition):
print('Inside')