I am following Virtual Button Sample in unity3d. I want check whether the touch(user's tap on screen) is in Virtual button Area (Rectangular). I am getting user's tap coordinate through "Input.mousePosition" and also button rectangle Area from "UpdateAreaRectangle();" function. I am also havnig bit confusion of getting rectangle area of button, lets say i want to get red button's rectagle area so I am doing following.
Debug.Log("is In Red button");
SO above code is right for to get Red button Rectangle. If Yes then how can I compare these values from screen tap position that whether touch is inside of Rectangle or outside. Thanks in advance.