Exemple #1
0
    void Update()
    {
        if (InputAdapter.Get().GetInputDown())
        {
            touchPhaseActive = true;

            CapturePointerData();
        }

        if (InputAdapter.Get().GetInput() && touchPhaseActive)
        {
            CapturePointerData();

            if (IsSameDirectionSwipe())
            {
            }
            else
            {
                OnSwipePhaseEnd();
            }
        }

        if (InputAdapter.Get().GetInputUp() && touchPhaseActive)
        {
            touchPhaseActive = false;
            OnSwipePhaseEnd();
        }
    }
Exemple #2
0
    void CapturePointerData()
    {
        PointerData pointerData = new PointerData();

        pointerData.position  = InputAdapter.Get().GetInputPosition();
        pointerData.time      = Time.time;
        pointerData.direction = FindDragDirection();

        if (pointerData.direction == SwipeDirection.invaild && pointerDataPoints.Count != 0)
        {
            return;
        }

        pointerData.ToString();
        pointerDataPoints.Add(pointerData);
    }