Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 15th, 2012  |  syntax: None  |  size: 0.62 KB  |  hits: 19  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. C# global alias
  2. #if UNITY_IPHONE
  3.  
  4. using iTouch = UnityEngine.Touch;
  5.  
  6. public class iTouchInput : MonoBehaviour  {
  7.  
  8.     public static iTouch[] getTouches() {
  9.         return Input.touches;
  10.     }
  11.  
  12. }
  13.  
  14.  
  15. #else
  16.  
  17. public struct iTouch {
  18.     public int fingerId;
  19.     public Vector2 position;
  20.     public Vector2 deltaPosition;
  21.     public float deltaTime;
  22.     public int tapCount;
  23.     public iTouchPhase phase;
  24. }
  25.  
  26. public class iTouchInput : MonoBehaviour  {
  27.  
  28.      private static iTouch[] touches;
  29.  
  30.      public static iTouch[] getTouches() {
  31.          return touches;
  32.      }
  33.  
  34. }
  35.  
  36. #endif
  37.        
  38. #if UNITY_IPHONE
  39. using iTouch = UnityEngine.Touch;
  40. #endif