示例#1
0
        public void ShowScreen(LoadingScreenDuration duration)
        {
            if (!shouldDisplay)
            {
                return;
            }

            minimumTimeActive = GetDuration(duration);
            timeActive        = 0f;
            loaded            = false;

            gameObject.SetActive(true);
            background.SetActive(true);
            loadingCircle.gameObject.SetActive(true);

            foregroundAnchoredPosTween = SlowSlide(foreground);

            wipNoticeGroup.alpha = 0f;
            this.Delay(() => {
                wipNoticeGroup.DOFade(1f, 1f);
                SlideIn(wipNotice)
                .OnComplete(() => wipNoticeAnchoredPosTween = SlowSlide(wipNotice));
            }, 0.5f);

            foregroundGroup.alpha = 0;
            foregroundAlphaTween  = foregroundGroup.DOFade(1f, 1f);

            StartCoroutine(WaitForDeactivation());
        }
示例#2
0
        private float GetDuration(LoadingScreenDuration duration)
        {
            switch (duration)
            {
            case LoadingScreenDuration.Long: return(5f);

            case LoadingScreenDuration.Short: return(2f);

            default: throw new ArgumentOutOfRangeException(nameof(duration));
            }
        }