/// <summary> /// 通过方向获取输入的坐标 /// </summary> /// <param name="dirType"></param> /// <returns></returns> public static Vector2 GetPosition(TouchDirType dirType) { #if UNITY_EDITOR return(Input.mousePosition); #elif UNITY_ANDROID || UNITY_IPHONE return(dirTypeTouch[dirType]); #endif }
public void OnTouchBegan(TouchDirType dirType) { if (dirType != touchDirType || touchActionActive == false) { return; } isPress = true; startPressPos = TouchManager.GetTouchPosition(touchDirType); }