I have 2 rectangle set up on where each is designed for a different functionality.
How do I do this?
public void OnPointerDown (PointerEventData data) {
if(Touch is inside rect 1) {
do my stuff x here
} elseif (Touch is inside rect 2) {
do my stuff y here
}
}
if (RectTransformUtility.RectangleContainsScreenPoint (
targetRectArea, data.position, data.pressEventCamera
)) {
//targetRectArea is the rectangle transform you want your
//input to be inside, the above will return true if it is inside.
}