Example #1
0
    void OnItemDragEvent(GameObject obj, UIObjDragEvent.DragState state, Vector2 pos)
    {
        switch (state)
        {
        case UIObjDragEvent.DragState.DragMove:
            ItemMove(obj, pos);
            break;

        case UIObjDragEvent.DragState.InvalideDrag:
            if (objMove != null)
            {
                objMove.gameObject.SetActive(false);
                objMove.transform.localPosition = Vector3.zero;
            }
            //  int index = GetIndexOfItem(obj);
            OnShowItemInUserInterface();
            isMove = false;
            break;

        case UIObjDragEvent.DragState.LongPressStart:
            ItemStartMove(obj);
            break;

        case UIObjDragEvent.DragState.DragEnd:
            ItemMoveEnd(obj, pos);
            break;
        }
    }
Example #2
0
        void OnItemDragEvent(GameObject obj, UIObjDragEvent.DragState state, Vector2 pos)
        {
            switch (state)
            {
            case UIObjDragEvent.DragState.DragMove:
                ItemMove(obj, pos);
                break;

            case UIObjDragEvent.DragState.InvalideDrag:
                if (mObjMove != null)
                {
                    mObjMove.gameObject.SetActive(false);
                }
                if (mIsMove)
                {
                    UpdatePackBySever();
                }
                ShowBackPackage(false);
                mIsMove = false;

                break;

            case UIObjDragEvent.DragState.LongPressStart:
                ItemStartMove(obj);
                ShowBackPackage(true);
                break;

            case UIObjDragEvent.DragState.DragEnd:
                ItemMoveEnd(obj, pos);
                break;
            }
        }