protected virtual Sequence ShowSlide()
        {
            Sequence showSequence = DOTween.Sequence();

            if (displaySlideIcons)
            {
                FadeAnimation slideIconAnimation = slideIconAnimations[currentSlideIndex];
                showSequence.Insert(slideIconAnimation.ShowStartUpTime, slideIconAnimation?.Show());
            }

            return(showSequence);
        }
예제 #2
0
        void CheckMenuActivation(Touch touch)
        {
            float horTouchDelta = touch.position.x - dragStartPosition.x;
            float lastHorDelta  = touch.deltaPosition.x;

            beganValidDrag    = false;
            dragStartPosition = touch.position;

            bool shouldShowMenu = (!isMenuActive && horTouchDelta > menuActivationDelta && lastHorDelta > 0);
            bool shouldHideMenu = (isMenuActive && horTouchDelta < menuDeactivationDelta && lastHorDelta < 0);

            if (shouldShowMenu || shouldHideMenu)
            {
                if (shouldShowMenu)
                {
                    ShowMenu();
                }
                else
                {
                    HideMenu();
                }
            }
            else
            {
                if (!isMenuActive)
                {
                    bgBlockerInterp = 0f;
                    slidingMenuAnimation.Hide();
                    Tween blockerHideTween = backgroundBlockerAnimation.Hide();
                    blockerHideTween.OnComplete(backgroundBlockerAnimation.Deactivate);
                }
                else
                {
                    bgBlockerInterp = 1f;
                    backgroundBlockerAnimation.Show();
                    Tween slideTween = slidingMenuAnimation.Show();
                    slideTween.OnComplete(() => SetMenuButtonsInteraction(enableInteraction: true));
                }
            }
        }