Example #1
0
    // Update is called once per frame
    void Update()
    {
        if (MyGestureListener.Instance != null && LayerJudge())
        {
            if (!Menu.gestureLock && CYZGestureManager.instance.flags[CYZGestureManager.Gesture.SwipeLeft] && CoolDown())
            {
                magnetic.Slide(true);
                lastSlideTime = Time.time;
            }

            if (!Menu.gestureLock && CYZGestureManager.instance.flags[CYZGestureManager.Gesture.SwipeRight] && CoolDown())
            {
                magnetic.Slide(false);
                lastSlideTime = Time.time;
            }

            if (!Menu.gestureLock && CYZGestureManager.instance.flags[CYZGestureManager.Gesture.Wave] && CoolDown())
            {
                switch (function)
                {
                case Function.Hide:
                    GetComponent <Shelf>().Hide();
                    break;
                }
            }
        }
    }
Example #2
0
    void ShelfDragOld()
    {
        if (!LayerJudge())
        {
            hold = false;
            shelf.EndDrag();
            return;
        }
        if (hold)
        {
            shelf.Slide(Input.mousePosition.x - mouseX);
        }

        if (Input.GetMouseButtonDown(0))
        {
            shelf.BeginDrag();
            hold   = true;
            mouseX = Input.mousePosition.x;
        }

        if (Input.GetMouseButtonUp(0))
        {
            hold = false;
            shelf.EndDrag();
        }
    }
Example #3
0
 void SlideRight()
 {
     // 下面这一步是用来做到头拉不动的动画的
     shelfList.BeginDrag();
     shelfList.Slide(-40);
     shelfList.EndDrag();
     shelfList.Slide(true);
 }