예제 #1
0
    //Touch / Click End
    private void TouchEnd()
    {
        //print("InputManager: touchEnd");

        //Set touch start & end values
        touchStarted = false;
        touchEnded   = true;
        //Add to hold time
        touchHoldTime += Time.deltaTime;
        //Update end pos only
        if (enableMouse)
        {
            touchEndPos = Input.mousePosition;
        }
        else
        {
            touchEndPos = Input.touches[0].position;
        };
        //Get Touch Type (Tap, Swipe(Dir), HeldPress)
        //	0 = Tap, 1 = Held Press, 2 = LeftSwipe, 3 = Right Swipe, 4 = UpSwipe, 5 = DownSwipe
        int touchType = GetTouchType(touchStartPos, touchEndPos, touchHoldTime);

        //Pass event info to action manager
        actionMan.TouchEvent(touchStartPos, touchEndPos, touchType);
    }