change download method

This commit is contained in:
CroakFang
2023-02-14 04:11:31 +08:00
parent a306035dce
commit 92038d87ec
2 changed files with 7 additions and 8 deletions
+4 -4
View File
@@ -18,17 +18,17 @@ public class UmaDatabaseEntry
var path = $"{Config.Instance.MainPath}\\dat\\{Url.Substring(0, 2)}\\{Url}";
if (!File.Exists(path) && Config.Instance.WorkMode == WorkMode.Standalone)
{
UmaViewerMain.Instance.StartCoroutine(DownloadAsset(this));
DownloadAsset(this);
}
return path;
}
}
public static IEnumerator DownloadAsset(UmaDatabaseEntry entry)
//TODO Make it async
public static void DownloadAsset(UmaDatabaseEntry entry)
{
var path = $"{Config.Instance.MainPath}\\dat\\{entry.Url.Substring(0, 2)}\\{entry.Url}";
yield return UmaViewerDownload.DownloadAsset(entry, path , delegate(string msg)
UmaViewerDownload.DownloadAssetSync(entry, path , delegate(string msg)
{
UmaViewerUI.Instance.MessagePannel.SetActive(true);
UmaViewerUI.Instance.MessageText.text = msg;