Ejemplo n.º 1
0
        public override IEnumerator CloseTo(SlidingSide side)
        {
            Sequence buttonSequence = m_buttonSlidingAnim.PlayAnim(open: false, side, side == SlidingSide.Right);
            Sequence elemSequence   = m_godList.TransitionAnim(open: false, side);

            m_closeDirector.set_time(0.0);
            m_closeDirector.Play();
            while (true)
            {
                if (!TweenExtensions.IsActive(elemSequence) && !TweenExtensions.IsActive(buttonSequence))
                {
                    PlayableGraph playableGraph = m_closeDirector.get_playableGraph();
                    if (!playableGraph.IsValid())
                    {
                        break;
                    }
                    playableGraph = m_closeDirector.get_playableGraph();
                    if (playableGraph.IsDone())
                    {
                        break;
                    }
                }
                yield return(null);
            }
        }
        public override IEnumerator OpenFrom(SlidingSide side)
        {
            for (int i = 0; i < m_slidingAnim.elements.Count; i++)
            {
                m_slidingAnim.elements[i].get_transform().set_localPosition(Vector3.get_zero());
            }
            Sequence slidingSequence = m_slidingAnim.PlayAnim(open: true, side, side == SlidingSide.Left);

            m_openDirector.set_time(0.0);
            m_openDirector.Play();
            while (true)
            {
                if (!TweenExtensions.IsActive(slidingSequence))
                {
                    PlayableGraph playableGraph = m_openDirector.get_playableGraph();
                    if (!playableGraph.IsValid())
                    {
                        break;
                    }
                    playableGraph = m_openDirector.get_playableGraph();
                    if (playableGraph.IsDone())
                    {
                        break;
                    }
                }
                yield return(null);
            }
        }
Ejemplo n.º 3
0
        public Sequence PlayAnim(bool open, SlidingSide side, bool reverseElementOrder = false)
        {
            //IL_0080: Unknown result type (might be due to invalid IL or missing references)
            //IL_0085: Unknown result type (might be due to invalid IL or missing references)
            //IL_0088: Unknown result type (might be due to invalid IL or missing references)
            //IL_008d: Unknown result type (might be due to invalid IL or missing references)
            //IL_0093: Unknown result type (might be due to invalid IL or missing references)
            //IL_0095: Unknown result type (might be due to invalid IL or missing references)
            //IL_0097: Unknown result type (might be due to invalid IL or missing references)
            //IL_009e: Unknown result type (might be due to invalid IL or missing references)
            //IL_00a0: Unknown result type (might be due to invalid IL or missing references)
            //IL_00a2: Unknown result type (might be due to invalid IL or missing references)
            //IL_00a7: Unknown result type (might be due to invalid IL or missing references)
            //IL_00ac: Unknown result type (might be due to invalid IL or missing references)
            //IL_00b0: Unknown result type (might be due to invalid IL or missing references)
            //IL_00b2: Unknown result type (might be due to invalid IL or missing references)
            //IL_00b7: Unknown result type (might be due to invalid IL or missing references)
            //IL_00bb: Unknown result type (might be due to invalid IL or missing references)
            //IL_00bd: Unknown result type (might be due to invalid IL or missing references)
            //IL_00d0: Unknown result type (might be due to invalid IL or missing references)
            //IL_00e0: Unknown result type (might be due to invalid IL or missing references)
            if (m_transitionTweenSequence != null && TweenExtensions.IsActive(m_transitionTweenSequence))
            {
                TweenExtensions.Kill(m_transitionTweenSequence, false);
            }
            SlidingAnimUIConfig slidingAnimUIConfig = open ? openConfig : closeConfig;

            m_transitionTweenSequence = DOTween.Sequence();
            float num = slidingAnimUIConfig.delay;

            for (int i = 0; i < elements.Count; i++)
            {
                int           index             = reverseElementOrder ? (elements.Count - 1 - i) : i;
                CanvasGroup   val               = elements[index];
                RectTransform val2              = val.get_transform() as RectTransform;
                Vector2       anchoredPosition  = val2.get_anchoredPosition();
                Vector2       anchorOffset      = slidingAnimUIConfig.anchorOffset;
                Vector2       val3              = (side == SlidingSide.Right) ? (anchoredPosition + anchorOffset) : (anchoredPosition - anchorOffset);
                Vector2       anchoredPosition2 = open ? val3 : anchoredPosition;
                Vector2       val4              = open ? anchoredPosition : val3;
                if (open)
                {
                    val.set_alpha(0f);
                }
                val2.set_anchoredPosition(anchoredPosition2);
                TweenSettingsExtensions.Insert(m_transitionTweenSequence, num, TweenSettingsExtensions.SetEase <Tweener>(DOTweenModuleUI.DOAnchorPos(val2, val4, slidingAnimUIConfig.duration, false), slidingAnimUIConfig.positionCurve));
                TweenSettingsExtensions.Insert(m_transitionTweenSequence, num, TweenSettingsExtensions.SetEase <Tweener>(DOTweenModuleUI.DOFade(val, slidingAnimUIConfig.endAlpha, slidingAnimUIConfig.duration), slidingAnimUIConfig.alphaCurve));
                num += slidingAnimUIConfig.elementDelayOffset;
            }
            return(m_transitionTweenSequence);
        }
Ejemplo n.º 4
0
 private void GotoSubState(SubState state, SlidingSide fromSide, bool tween = true)
 {
     InactivityHandler.UpdateActivity();
     if (state == SubState.GodSelection)
     {
         GodSelectionState godSelectionState = new GodSelectionState();
         godSelectionState.onGodSelected = (Action <God>)Delegate.Combine(godSelectionState.onGodSelected, new Action <God>(OnGodSelected));
         m_ui.SetStateIndex(0, tween);
         BaseFightSelectionState baseFightSelectionState = godSelectionState;
         m_ui.returnButton.set_interactable(false);
         baseFightSelectionState.fromSide            = fromSide;
         baseFightSelectionState.onUIOpeningFinished = OnChildUIOpeningFinished;
         this.SetChildState(baseFightSelectionState, 0);
         return;
     }
     throw new ArgumentOutOfRangeException("state", state, null);
 }
Ejemplo n.º 5
0
        public override IEnumerator OpenFrom(SlidingSide side)
        {
            Sequence elemSequence = m_slidingAnim.PlayAnim(open: true, side, side == SlidingSide.Left);

            m_openDirector.set_time(0.0);
            m_openDirector.Play();
            while (true)
            {
                if (!TweenExtensions.IsActive(elemSequence))
                {
                    PlayableGraph playableGraph = m_openDirector.get_playableGraph();
                    if (!playableGraph.IsValid())
                    {
                        break;
                    }
                    playableGraph = m_openDirector.get_playableGraph();
                    if (playableGraph.IsDone())
                    {
                        break;
                    }
                }
                yield return(null);
            }
        }
 public abstract IEnumerator CloseTo(SlidingSide side);
 public abstract IEnumerator OpenFrom(SlidingSide side);