Quantcast
Channel: Unity Forum
Viewing all articles
Browse latest Browse all 1466670

Detect if touch is inside a specific rect transform area.

$
0
0
I have 2 rectangle set up on where each is designed for a different functionality.
How do I do this?
Code (CSharp):
  1.     public  void OnPointerDown (PointerEventData data) {
  2.         if(Touch is inside rect 1) {
  3.              do my stuff x here
  4.         } elseif (Touch is inside rect 2) {
  5.              do my stuff y here
  6.         }
  7.     }
Thank you!

Viewing all articles
Browse latest Browse all 1466670

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>