Beispiel #1
0
        private void Update()
        {
            //No need to check for Input if no UIDrawers exist.
            if (drawers == null || drawers.Count < 1)
            {
                return;
            }

            CheckInitialInputPosition();

            if (Input.GetMouseButtonUp(0))
            {
                canDrag    = false;
                isDragging = false;
                ResetInputPositions();
                uIDrawerSide = UIDrawerSide.NEUTRAL;
            }

            //Can't act on a null UIDrawer.
            if (currentDrawer == null)
            {
                return;
            }

            if (canDrag)
            {
                DragDrawer();
            }

            if (Input.GetMouseButtonUp(0))
            {
                if (!isDragging && aDrawerIsVisible)
                {
                    currentDrawer.Hide();
                }

                currentDrawer.CheckVisibility();
            }

            if (Input.GetMouseButton(0) && aDrawerIsVisible)
            {
                DragDrawer();
            }
        }
Beispiel #2
0
 private void ProccessInitialInputPosition(UIDrawerSide _uIDrawerSide)
 {
     canDrag      = true;
     uIDrawerSide = _uIDrawerSide;
     GetCurrentDrawer();
 }