private void Update() { if (loadingController == null && Service.IsSet <LoadingController>()) { loadingController = Service.Get <LoadingController>(); } float num = 0f; float num2 = 0f; num = ((loadingController == null) ? 1f : (loadingController.DownloadProgress.HasValue ? loadingController.DownloadProgress.Value : 1f)); if (bundleManager == null && Service.IsSet <BundlePrecacheManager>()) { bundleManager = Service.Get <BundlePrecacheManager>(); } num2 = ((bundleManager == null) ? 1f : ((!bundleManager.IsCaching) ? 1f : bundleManager.CompleteRatio)); num2 = num2 / 2f + num / 2f; num2 = Mathf.Lerp(0f, num2, currentTime); Vector2 anchoredPosition = fillStripes.anchoredPosition; currentTime += Time.deltaTime; currentTime %= fillStripesRepeatSeconds; float num3 = currentTime / fillStripesRepeatSeconds; float num4 = (anchoredPosition.x = num3 * fillStripesParent.rect.width); fillStripes.anchoredPosition = anchoredPosition; if (num2 >= 1f - Mathf.Epsilon) { FullProgressCompleted = true; } else if (FullProgressCompleted) { setSpecificEmoji(); FullProgressCompleted = false; isPlayingSpinner = false; } if (!FullProgressCompleted || !isPlayingSpinner) { progressBarFillRectTransform.anchorMax = new Vector2(num2, progressBarFillRectTransform.anchorMax.y); float x = num2 * progressbarWidth; emojiRectTransform.anchoredPosition = new Vector2(x, emojiRectTransform.anchoredPosition.y); int a = (int)Mathf.Max(0f, (float)tintSelector.Colors.Length * num2); uint num5 = (uint)Mathf.Min(a, tintSelector.Colors.Length - 1); tintSelector.SelectColor((int)num5); if (isGenericProgressBar && SetEmoji == null) { setEmojiIndex(num5 + 1); } if (FullProgressCompleted) { setEmojiIndex(0u); isPlayingSpinner = true; } } }
private void OnEnable() { if (ProgressBarFill != null) { progressBarFillRectTransform = ProgressBarFill.GetComponent <RectTransform>(); fillStripesParent = (RectTransform)fillStripes.parent; tintSelector = ProgressBarFill.GetComponentInChildren <TintSelector>(); milestoneProgress = progressBarFillRectTransform.rect.width / (float)tintSelector.Colors.Length; progressbarWidth = progressBarFillRectTransform.rect.width; gradualProgress = 0f; } if (Emojis != null) { emojiRectTransform = Emojis.GetComponent <RectTransform>(); setSpecificEmoji(); } bundleManager = Service.Get <BundlePrecacheManager>(); currentTime = 0f; isPlayingSpinner = false; Update(); }
protected override void Awake() { base.Awake(); bundlePrecacheManager = Service.Get <BundlePrecacheManager>(); }