Hyluss

[Unity] EventSystem.current.IsPointerOverGameObject

Nov 27th, 2017
352
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.30 KB | None | 0 0
  1.         if (Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Began)
  2.         {
  3.             // Check if finger is over a UI element
  4.             if (EventSystem.current.IsPointerOverGameObject (Input.GetTouch (0).fingerId))
  5.             {              
  6.                 Debug.Log ("Touched the UI");
  7.             }
  8.             else
  9.             {
  10.                 GetInteraction();
  11.             }
  12.         }
Advertisement
Comments
  • User was banned
Add Comment
Please, Sign In to add comment