private void On_Swipe(Gesture gesture)
        {
            if (!mIsAllowTouch)
            {
                return;
            }
            if (!isEnableCtrl)
            {
                return;
            }
            if (gesture.touchCount == 1)
            {
                if (mPbKeyframeManager.CurKeyFrame == null)
                {
                    return;
                }
                transform.RotateAround(mCurRotateCenter, Vector3.up, gesture.deltaPosition.x * -0.1f);
                if (!mStartAllowUpDown)
                {
                    return;
                }
                switch (gesture.swipe)
                {
                case EasyTouch.SwipeDirection.None:
                case EasyTouch.SwipeDirection.Other:
                case EasyTouch.SwipeDirection.DownLeft:
                case EasyTouch.SwipeDirection.DownRight:
                case EasyTouch.SwipeDirection.UpLeft:
                case EasyTouch.SwipeDirection.UpRight:
                    return;

                case EasyTouch.SwipeDirection.Up:
                    if (mPreDirction == EasyTouch.SwipeDirection.Down || !IsClamping(transform))
                    {
                        transform.RotateAround(mCurRotateCenter, Vector3.forward, gesture.deltaPosition.y * -0.1f);
                    }
                    LimitTranAngle(transform);
                    mPreDirction = EasyTouch.SwipeDirection.Up;
                    break;

                case EasyTouch.SwipeDirection.Down:
                    if (mPreDirction == EasyTouch.SwipeDirection.Up || !IsClamping(transform))
                    {
                        transform.RotateAround(mCurRotateCenter, Vector3.forward, gesture.deltaPosition.y * -0.1f);
                    }
                    LimitTranAngle(transform);
                    mPreDirction = EasyTouch.SwipeDirection.Down;
                    break;

                case EasyTouch.SwipeDirection.Left:
                case EasyTouch.SwipeDirection.Right:
                    transform.RotateAround(mCurRotateCenter, Vector3.up, gesture.deltaPosition.x * -0.1f);
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }
            }
        }
Example #2
0
 public void SetSecret()
 {
     m_index  = 0;
     m_Secret = new EasyTouch.SwipeDirection[] {
         EasyTouch.SwipeDirection.Right,
         EasyTouch.SwipeDirection.Down,
         EasyTouch.SwipeDirection.Left,
         EasyTouch.SwipeDirection.Up
     };
 }
Example #3
0
    void OnSwipe(Gesture gesture)
    {
        isSwipe = true;
        if (gesture.swipe == EasyTouch.SwipeDirection.Other)
        {
            return;
        }

        if (gesture.swipe != lastSwipe)
        {
            Debug.Log($"滑动方向 {gesture.swipe}");
            lastSwipe = gesture.swipe;
        }
    }
Example #4
0
        private void InputSecret(EasyTouch.SwipeDirection sd)
        {
            if (m_Secret == null)
            {
                return;
            }

            if (m_Secret[m_index] != sd)
            {
                m_index = 0;
                return;
            }

            ++m_index;
            if (m_index >= m_Secret.Length)
            {
                m_index = 0;
                Success();
            }
        }
Example #5
0
 void OnSwipeEnd(Gesture gesture)
 {
     lastSwipe = EasyTouch.SwipeDirection.None;
     isSwipe   = false;
     Debug.Log($"OnSwipeEnd swipe:{gesture.swipe} Length:{gesture.swipeLength} swipeVector:{gesture.swipeVector} twistAngle:{gesture.twistAngle}");
 }