示例#1
0
 public static bool Touch(int index = 0)
 {
     if (BlockInput)
     {
         return(false);
     }
                 #if UNITY_EDITOR || UNITY_STANDALONE
     return(Input.GetMouseButton(0));
                 #else
     return(InputWrapper.touchCount > index && (InputWrapper.GetTouch(index).phase == TouchPhase.Stationary || InputWrapper.GetTouch(index).phase == TouchPhase.Moved));
                 #endif
 }
示例#2
0
 public static Vector3 TouchPosition(int index = 0)
 {
 #if UNITY_EDITOR || UNITY_STANDALONE
     return(Input.mousePosition);
 #else
     if (InputWrapper.touchCount == 0)
     {
         return(Vector3.zero);
     }
     return(InputWrapper.GetTouch(index).position);
 #endif
 }
示例#3
0
 public static bool TouchDown(int index = 0)
 {
     if (BlockInput)
     {
         return(false);
     }
 #if UNITY_EDITOR || UNITY_STANDALONE
     return(Input.GetMouseButtonDown(index));
 #else
     return(InputWrapper.touchCount > index && InputWrapper.GetTouch(index).phase == TouchPhase.Began);
 #endif
 }