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()); }
private float GetDuration(LoadingScreenDuration duration) { switch (duration) { case LoadingScreenDuration.Long: return(5f); case LoadingScreenDuration.Short: return(2f); default: throw new ArgumentOutOfRangeException(nameof(duration)); } }