|
@@ -1,7 +1,5 @@
|
|
-using System.Collections;
|
|
+using FairyGUI;
|
|
-using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
using UnityEngine;
|
|
-using UnityEngine.UI;
|
|
|
|
|
|
|
|
namespace ET
|
|
namespace ET
|
|
{
|
|
{
|
|
@@ -9,26 +7,30 @@ namespace ET
|
|
{
|
|
{
|
|
void Start()
|
|
void Start()
|
|
{
|
|
{
|
|
- var progress = this.gameObject.transform.Find("Img_bar").gameObject.GetComponent<Image>();
|
|
+ var view = UIPackage.CreateObject("CheckForResUpdate", "CheckForResUpdate").asCom;
|
|
- var txtProgress = this.gameObject.transform.Find("Text_progress").gameObject.GetComponent<Text>();
|
|
+ GRoot.inst.AddChild(view);
|
|
|
|
|
|
|
|
+ var progress = view.GetChild("processbar").asProgress;
|
|
|
|
+ var txtProgress = view.GetChild("updateInfo");
|
|
|
|
+
|
|
YooAssetProxy.InitHostCallbacks((onStateChanged) =>
|
|
YooAssetProxy.InitHostCallbacks((onStateChanged) =>
|
|
{
|
|
{
|
|
txtProgress.text = onStateChanged.CurrentStates.ToString();
|
|
txtProgress.text = onStateChanged.CurrentStates.ToString();
|
|
|
|
|
|
if (onStateChanged.CurrentStates == EPatchStates.PatchDone)
|
|
if (onStateChanged.CurrentStates == EPatchStates.PatchDone)
|
|
{
|
|
{
|
|
- txtProgress.text = "资源下载完毕,正在加载核心逻辑。。。";
|
|
+ progress.value = 1f;
|
|
|
|
+ txtProgress.text = "加载游戏中……";
|
|
}
|
|
}
|
|
}, (onProcessUpdated) =>
|
|
}, (onProcessUpdated) =>
|
|
{
|
|
{
|
|
string currentSizeMB = (onProcessUpdated.CurrentDownloadSizeBytes / 1048576f).ToString("f1");
|
|
string currentSizeMB = (onProcessUpdated.CurrentDownloadSizeBytes / 1048576f).ToString("f1");
|
|
string totalSizeMB = (onProcessUpdated.TotalDownloadSizeBytes / 1048576f).ToString("f1");
|
|
string totalSizeMB = (onProcessUpdated.TotalDownloadSizeBytes / 1048576f).ToString("f1");
|
|
string text =
|
|
string text =
|
|
- $"资源下载中:{onProcessUpdated.CurrentDownloadCount}/{onProcessUpdated.TotalDownloadCount} {currentSizeMB}MB/{totalSizeMB}MB";
|
|
+ $"更新资源中:{onProcessUpdated.CurrentDownloadCount}/{onProcessUpdated.TotalDownloadCount} {currentSizeMB}MB/{totalSizeMB}MB";
|
|
|
|
|
|
txtProgress.text = text;
|
|
txtProgress.text = text;
|
|
- progress.fillAmount = onProcessUpdated.CurrentDownloadSizeBytes * 1.0f /
|
|
+ progress.value = onProcessUpdated.CurrentDownloadSizeBytes * 1.0f /
|
|
onProcessUpdated.TotalDownloadSizeBytes;
|
|
onProcessUpdated.TotalDownloadSizeBytes;
|
|
});
|
|
});
|
|
}
|
|
}
|