public static Touch GetTouch(int id) { #if UNITY_EDITOR || UNITY_STANDALONE || UNITY_WEBGL return(MakefakeTouchOnPc()); #endif #if !UNITY_EDITOR && (UNITY_ANDROID || UNITY_IPHONE || UNITY_IOS || UNITY_WP_8 || UNITY_WP_8_1) return(Input.GetTouch(id)); #endif }
int GetAnalogTouchFingerIDInsideArea(int id) { #if UNITY_EDITOR || UNITY_STANDALONE || UNITY_WEBGL return(id); #endif #if !UNITY_EDITOR && (UNITY_ANDROID || UNITY_IPHONE || UNITY_IOS || UNITY_WP_8 || UNITY_WP_8_1) if (id == -1) { return(-1); } return(Input.GetTouch(id).fingerId); #endif }
public static Touch GetTouchByFingerID(int fingerID) { #if UNITY_EDITOR || UNITY_STANDALONE || UNITY_WEBGL return(MakefakeTouchOnPc()); #endif #if !UNITY_EDITOR && (UNITY_ANDROID || UNITY_IPHONE || UNITY_IOS || UNITY_WP_8 || UNITY_WP_8_1) for (int i = 0; i < Input.touchCount; i++) { if (Input.GetTouch(i).fingerId == fingerID) { return(Input.GetTouch(i)); } } return(new Touch()); #endif }
int GetAnalogFingerIDInsideArea() { #if UNITY_EDITOR || UNITY_STANDALONE || UNITY_WEBGL if ((UnityEngine.Input.GetMouseButtonDown(0) || UnityEngine.Input.GetMouseButtonUp(0) || UnityEngine.Input.GetMouseButton(0)) && IsInsideArea(UnityEngine.Input.mousePosition)) { return(0); } else { return(-1); } #endif #if !UNITY_EDITOR && (UNITY_ANDROID || UNITY_IPHONE || UNITY_IOS || UNITY_WP_8 || UNITY_WP_8_1) for (int i = 0; i < Input.touchCount; i++) { if (IsInsideArea(Input.GetTouch(i).position)) { return(i); } } return(-1); #endif }