示例#1
0
    /// <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
    }
示例#2
0
    public void OnTouchBegan(TouchDirType dirType)
    {
        if (dirType != touchDirType || touchActionActive == false)
        {
            return;
        }

        isPress       = true;
        startPressPos = TouchManager.GetTouchPosition(touchDirType);
    }