Advertisement
Frank84

Handle Multitouch

Sep 29th, 2011
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.44 KB | None | 0 0
  1. if (Input.touchCount > 0)
  2. {
  3.     // Playing on an iOS device. Multi-touch.
  4.     foreach (Touch touch in Input.touches)
  5.     {
  6.         if (touch.phase != TouchPhase.Ended && touch.phase != TouchPhase.Canceled)
  7.         {
  8.             MyProcessTouchHeldDownMethod(touch.position);
  9.         }
  10.     }
  11. }
  12. else if (Input.GetMouseButton(0) == true)
  13. {
  14.     // Playing in the Editor. Single-touch.
  15.     MyProcessTouchHeldDownMethod(Input.mousePosition);
  16. }
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement