From 51b0f6ed9f4e1d3bb6f8144470b46908c7699a96 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期一, 11 五月 2026 16:20:37 +0800
Subject: [PATCH] Merge branch 'master' into h5version
---
Main/System/ClientVersion/VersionUtility.cs | 24 +++++++++++++++++-------
1 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/Main/System/ClientVersion/VersionUtility.cs b/Main/System/ClientVersion/VersionUtility.cs
index 4b1a20b..3c1bc55 100644
--- a/Main/System/ClientVersion/VersionUtility.cs
+++ b/Main/System/ClientVersion/VersionUtility.cs
@@ -1,4 +1,4 @@
-//--------------------------------------------------------
+锘�//--------------------------------------------------------
// [Author]: 鐜╀釜娓告垙
// [ Date ]: Thursday, March 15, 2018
//--------------------------------------------------------
@@ -10,13 +10,14 @@
using LitJson;
using System.IO;
using System.Text;
+using Cysharp.Threading.Tasks;
public class VersionUtility : Singleton<VersionUtility>
{
// public static readonly string[] VERSION_URL = new string[] {
- // "http://xssgcenter.secondworld.net.cn:11000/center/appversion_new.php/?"};
+ // "http://gamecenter.secondworld.net.cn:11000/center/appversion_new.php/?"};
public string androidRoot { get { return string.Empty;/*StringUtility.Concat(SDKUtils.Instance.DeviceRootPath, "/", VersionConfig.Get().bundleIdentifier);*/ } }
@@ -96,11 +97,13 @@
{
step = Step.Completed;
+#if !UNITY_WEBGL
var apkFiles = new DirectoryInfo(ResourcesPath.Instance.ExternalStorePath).GetFiles("*.apk");
for (int i = apkFiles.Length - 1; i >= 0; i--)
{
File.Delete(apkFiles[i].FullName);
}
+#endif
}
}
else
@@ -117,7 +120,7 @@
public void RequestApkDownConfigs()
{
// YLTODO
- // UIManager.Instance.OpenWindow<VersionUpdateWin>();
+ // UIManager.Instance.OpenWindowAsync<VersionUpdateWin>().Forget();
// // WindowCenter.Instance.OpenFromLocal<VersionUpdateWin>();
}
@@ -228,13 +231,13 @@
/// 鏄惁涓篿os瀹℃牳鏃堕棿鍐�
/// </summary>
/// <returns></returns>
- public bool InIosAuditTime()
+ public async UniTask<bool> InIosAuditTime()
{
DateTime dateTime;
try
{
- var textAsset = Resources.Load<UnityEngine.TextAsset>("Config/AuditTime");
+ var textAsset = await Resources.LoadAsync<UnityEngine.TextAsset>("Config/AuditTime") as UnityEngine.TextAsset;
var content = string.Empty;
if (textAsset != null)
{
@@ -253,7 +256,7 @@
return false;
}
}
- catch (System.Exception ex)
+ catch (System.Exception)
{
return false;
}
@@ -261,7 +264,14 @@
public bool NeedDownAsset()
{
- if (versionInfo != null && versionInfo.downAsset == 1 && VersionConfig.Get().assetAccess != InstalledAsset.IngoreDownLoad)
+ if (VersionConfig.config == null)
+ {
+ VersionConfig.GetAsync().Forget();
+ Debug.LogError("VersionConfig is null when check NeedDownAsset, check VersionConfig.GetAsync for more details");
+ return false;
+ }
+
+ if (versionInfo != null && versionInfo.downAsset == 1 && VersionConfig.config.assetAccess != InstalledAsset.IngoreDownLoad)
{
return true;
}
--
Gitblit v1.8.0