public static Tween PopImmediately(AnimatedScreen screen)
        {
            Sequence sequence = DOTween.Sequence();

            sequence.PrependCallback(() => ValidatePopTween(sequence, screen));
            sequence.Append(screen.HideTween
                            .AddOnComplete(() =>
            {
                stack.Pop();

                CurrentScreen?.Show();
            }));

            return(sequence);
        }
        public static Tween PushImmediately(AnimatedScreen screen)
        {
            Sequence sequence = DOTween.Sequence();

            sequence.PrependCallback(() => ValidatePushTween(sequence, screen));
            sequence.Append(screen.ShowTween
                            .AddOnStart(() =>
            {
                foreach (Screen otherScreen in stack)
                {
                    if (otherScreen.IsEnabled)
                    {
                        otherScreen.Hide();
                    }
                }
            })
                            .AddOnComplete(() => stack.Push(screen)));

            return(sequence);
        }
        public static Tween Pop(AnimatedScreen screen)
        {
            Sequence sequence = DOTween.Sequence();

            sequence.PrependCallback(() => ValidatePopTween(sequence, screen));
            sequence.Append(screen.HideTween
                            .AddOnComplete(() => stack.Pop()));
            Screen nextScreen = GetNextScreen();

            if (nextScreen != null)
            {
                if (nextScreen is AnimatedScreen nextAnimatedScreen)
                {
                    sequence.Append(nextAnimatedScreen.ShowTween);
                }
                else
                {
                    sequence.AppendCallback(nextScreen.Show);
                }
            }

            return(sequence);
        }
        public static Tween Push(AnimatedScreen screen)
        {
            Sequence sequence = DOTween.Sequence();

            sequence.PrependCallback(() => ValidatePushTween(sequence, screen));
            foreach (Screen otherScreen in stack)
            {
                if (otherScreen.IsEnabled)
                {
                    if (otherScreen is AnimatedScreen otherAnimatedScreen)
                    {
                        sequence.Append(otherAnimatedScreen.HideTween);
                    }
                    else
                    {
                        sequence.AppendCallback(otherScreen.Hide);
                    }
                }
            }
            sequence.Append(screen.ShowTween
                            .AddOnComplete(() => stack.Push(screen)));

            return(sequence);
        }