From 39001a600fcae2bcf27c225df8752d75fb92fef4 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期五, 31 十月 2025 11:18:26 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_scripts
---
Main/System/AssetVersion/DownLoadWin.cs | 250 ++++++++++++++++++++++++-------------------------
1 files changed, 124 insertions(+), 126 deletions(-)
diff --git a/Main/System/AssetVersion/DownLoadWin.cs b/Main/System/AssetVersion/DownLoadWin.cs
index 10765ba..f9f444e 100644
--- a/Main/System/AssetVersion/DownLoadWin.cs
+++ b/Main/System/AssetVersion/DownLoadWin.cs
@@ -1,5 +1,5 @@
锘�//--------------------------------------------------------
-// [Author]: 绗簩涓栫晫
+// [Author]: 鐜╀釜娓告垙
// [ Date ]: Tuesday, January 09, 2018
//--------------------------------------------------------
@@ -9,146 +9,144 @@
using UnityEngine;
using UnityEngine.UI;
- public class DownLoadWin : UIBase
+public class DownLoadWin : UIBase
+{
+ [SerializeField] RectTransform m_ContainerHint;
+ [SerializeField] RichText m_Content;
+ [SerializeField] Button m_Confirm;
+ [SerializeField] Button m_Cancel;
+
+ [SerializeField] Transform m_ContainerProgress;
+ [SerializeField] SmoothSlider m_ProgressSlider;
+ [SerializeField] Text m_Progress;
+ [SerializeField] Text m_DownLoadSpeed;
+
+ float timer = 1f;
+
+ protected override void InitComponent()
{
- [SerializeField] RectTransform m_ContainerHint;
- [SerializeField] RichText m_Content;
- [SerializeField] Button m_Confirm;
- [SerializeField] Button m_Cancel;
+ m_Confirm.AddListener(Confirm);
+ m_Cancel.AddListener(Cancel);
+ }
- [SerializeField] Transform m_ContainerProgress;
- [SerializeField] SmoothSlider m_ProgressSlider;
- [SerializeField] Text m_Progress;
- [SerializeField] Text m_DownLoadSpeed;
- [SerializeField] Transform awardObj;
-
- float timer = 1f;
-
- protected override void InitComponent()
+ protected override void OnPreOpen()
+ {
+ timer = 1f;
+ if (Application.internetReachability == NetworkReachability.ReachableViaLocalAreaNetwork)
{
- m_Confirm.AddListener(Confirm);
- m_Cancel.AddListener(Cancel);
+ DownLoadAndDiscompressHotTask.Instance.StartDownLoad();
}
- protected override void OnPreOpen()
+ OnDownLoadStepChange(DownLoadAndDiscompressHotTask.Instance.step);
+
+ }
+
+ protected override void OnOpen()
+ {
+ DownLoadAndDiscompressHotTask.Instance.downLoadStepChangeEvent += OnDownLoadStepChange;
+ }
+
+ protected override void OnPreClose()
+ {
+ DownLoadAndDiscompressHotTask.Instance.downLoadStepChangeEvent -= OnDownLoadStepChange;
+ }
+
+ protected override void OnClose()
+ {
+ }
+
+ private void OnDownLoadStepChange(DownLoadAndDiscompressHotTask.Step _step)
+ {
+ switch (_step)
{
- timer = 1f;
- if (Application.internetReachability == NetworkReachability.ReachableViaLocalAreaNetwork)
+ case DownLoadAndDiscompressHotTask.Step.DownLoadPrepared:
+ m_ContainerHint.SetActive(true);
+ m_ContainerProgress.SetActive(false);
+ DisplayHintContent();
+ break;
+ case DownLoadAndDiscompressHotTask.Step.DownLoad:
+ m_ContainerHint.SetActive(false);
+ m_ContainerProgress.SetActive(true);
+ DisplayHintContent();
+ break;
+ }
+ }
+
+ protected void LateUpdate()
+ {
+ var step = DownLoadAndDiscompressHotTask.Instance.step;
+ if (step == DownLoadAndDiscompressHotTask.Step.DownLoad)
+ {
+ timer += Time.deltaTime;
+ if (timer > 1f)
{
- DownLoadAndDiscompressTask.Instance.StartDownLoad();
- }
+ timer -= 1f;
+ m_ProgressSlider.value = DownLoadAndDiscompressHotTask.Instance.progress;
+ var totalSizeString = ((float)DownLoadAndDiscompressHotTask.Instance.totalSize / DownLoadAndDiscompressHotTask.BYTE_PER_MILLIONBYTE).ToString("f1");
+ var downLoadedSize = Mathf.Clamp(DownloadHotMgr.Instance.DownloadedBytes, 0, DownLoadAndDiscompressHotTask.Instance.totalSize - 1);
+ var downLoadedSizeString = ((float)downLoadedSize / DownLoadAndDiscompressHotTask.BYTE_PER_MILLIONBYTE).ToString("f1");
- OnDownLoadStepChange(DownLoadAndDiscompressTask.Instance.step);
+ m_Progress.text = Language.GetFromLocal(13, StringUtility.Contact(downLoadedSizeString, "M", "/", totalSizeString, "M"));
- awardObj.SetActive(InGameDownLoad.Instance.IsShowDownloadAward());
- }
-
- protected override void OnOpen()
- {
- DownLoadAndDiscompressTask.Instance.downLoadStepChangeEvent += OnDownLoadStepChange;
- }
-
- protected override void OnPreClose()
- {
- DownLoadAndDiscompressTask.Instance.downLoadStepChangeEvent -= OnDownLoadStepChange;
- }
-
- protected override void OnClose()
- {
- }
-
- private void OnDownLoadStepChange(DownLoadAndDiscompressTask.Step _step)
- {
- switch (_step)
- {
- case DownLoadAndDiscompressTask.Step.DownLoadPrepared:
- m_ContainerHint.SetActive(true);
- m_ContainerProgress.SetActive(false);
- DisplayHintContent();
- break;
- case DownLoadAndDiscompressTask.Step.DownLoad:
- m_ContainerHint.SetActive(false);
- m_ContainerProgress.SetActive(true);
- DisplayHintContent();
- break;
- }
- }
-
- protected void LateUpdate()
- {
- var step = DownLoadAndDiscompressTask.Instance.step;
- if (step == DownLoadAndDiscompressTask.Step.DownLoad)
- {
- timer += Time.deltaTime;
- if (timer > 1f)
+ if (downLoadedSize >= DownLoadAndDiscompressHotTask.Instance.totalSize)
{
- timer -= 1f;
- m_ProgressSlider.value = DownLoadAndDiscompressTask.Instance.progress;
- var totalSizeString = ((float)DownLoadAndDiscompressTask.Instance.totalSize / DownLoadAndDiscompressTask.BYTE_PER_MILLIONBYTE).ToString("f1");
- var downLoadedSize = Mathf.Clamp(DownloadMgr.Instance.DownloadedBytes, 0, DownLoadAndDiscompressTask.Instance.totalSize - 1);
- var downLoadedSizeString = ((float)downLoadedSize / DownLoadAndDiscompressTask.BYTE_PER_MILLIONBYTE).ToString("f1");
-
- m_Progress.text = Language.GetFromLocal(13, StringUtility.Contact(downLoadedSizeString, "M", "/", totalSizeString, "M"));
-
- if (downLoadedSize >= DownLoadAndDiscompressTask.Instance.totalSize)
- {
- m_DownLoadSpeed.text = StringUtility.Contact(UnityEngine.Random.Range(5, 10), "KB/S");
- }
- else
- {
- m_DownLoadSpeed.text = DownloadMgr.Instance.SpeedFormat;
- }
+ m_DownLoadSpeed.text = StringUtility.Contact(UnityEngine.Random.Range(5, 10), "KB/S");
+ }
+ else
+ {
+ m_DownLoadSpeed.text = DownloadHotMgr.Instance.SpeedFormat;
}
}
}
-
- private void DisplayHintContent()
- {
- var step = DownLoadAndDiscompressTask.Instance.step;
-
- switch (step)
- {
- case DownLoadAndDiscompressTask.Step.DownLoadPrepared:
- var totalCount = DownLoadAndDiscompressTask.Instance.totalCount;
- var totalSize = DownLoadAndDiscompressTask.Instance.totalSize;
-
- if (totalSize > DownLoadAndDiscompressTask.BYTE_PER_MILLIONBYTE)
- {
- var sizeDescription = ((float)totalSize / DownLoadAndDiscompressTask.BYTE_PER_MILLIONBYTE).ToString("f1");
- m_Content.text = Language.GetFromLocal(DownLoadAndDiscompressTask.Instance.restartApp ? 1 : 2, totalCount, sizeDescription);
- }
- else
- {
- var sizeDescription = ((float)totalSize / DownLoadAndDiscompressTask.BYTE_PER_KILOBYTE).ToString("f1");
- m_Content.text = Language.GetFromLocal(DownLoadAndDiscompressTask.Instance.restartApp ? 11 : 12, totalCount, sizeDescription);
- }
- break;
- case DownLoadAndDiscompressTask.Step.DownLoad:
- m_Content.text = Language.GetFromLocal(3);
- break;
- }
- }
-
- private void Confirm()
- {
- timer = 1f;
- var step = DownLoadAndDiscompressTask.Instance.step;
-
- switch (step)
- {
- case DownLoadAndDiscompressTask.Step.DownLoadPrepared:
- DownLoadAndDiscompressTask.Instance.StartDownLoad();
- break;
- }
- }
-
- private void Cancel()
- {
- Application.Quit();
- }
-
}
+ private void DisplayHintContent()
+ {
+ var step = DownLoadAndDiscompressHotTask.Instance.step;
+
+ switch (step)
+ {
+ case DownLoadAndDiscompressHotTask.Step.DownLoadPrepared:
+ var totalCount = DownLoadAndDiscompressHotTask.Instance.totalCount;
+ var totalSize = DownLoadAndDiscompressHotTask.Instance.totalSize;
+
+ if (totalSize > DownLoadAndDiscompressHotTask.BYTE_PER_MILLIONBYTE)
+ {
+ var sizeDescription = ((float)totalSize / DownLoadAndDiscompressHotTask.BYTE_PER_MILLIONBYTE).ToString("f1");
+ m_Content.text = Language.GetFromLocal(DownLoadAndDiscompressHotTask.Instance.restartApp ? 1 : 2, totalCount, sizeDescription);
+ }
+ else
+ {
+ var sizeDescription = ((float)totalSize / DownLoadAndDiscompressHotTask.BYTE_PER_KILOBYTE).ToString("f1");
+ m_Content.text = Language.GetFromLocal(DownLoadAndDiscompressHotTask.Instance.restartApp ? 11 : 12, totalCount, sizeDescription);
+ }
+ break;
+ case DownLoadAndDiscompressHotTask.Step.DownLoad:
+ m_Content.text = Language.GetFromLocal(3);
+ break;
+ }
+ }
+
+ private void Confirm()
+ {
+ timer = 1f;
+ var step = DownLoadAndDiscompressHotTask.Instance.step;
+
+ switch (step)
+ {
+ case DownLoadAndDiscompressHotTask.Step.DownLoadPrepared:
+ DownLoadAndDiscompressHotTask.Instance.StartDownLoad();
+ break;
+ }
+ }
+
+ private void Cancel()
+ {
+ Application.Quit();
+ }
+
+}
+
--
Gitblit v1.8.0