From 6784ab2f0325f1bc4afef6258664e3a382a578e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BD=97=E5=AE=B6=E7=82=9C?= <2029049582@qq.com> Date: Fri, 12 Sep 2025 02:47:38 +0800 Subject: [PATCH] =?UTF-8?q?iso=E8=AF=BB=E5=8F=96=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wb_unity_pro/Assets/Scripts/VerCheck.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/wb_unity_pro/Assets/Scripts/VerCheck.cs b/wb_unity_pro/Assets/Scripts/VerCheck.cs index b3146b8a..15c50d7d 100644 --- a/wb_unity_pro/Assets/Scripts/VerCheck.cs +++ b/wb_unity_pro/Assets/Scripts/VerCheck.cs @@ -337,6 +337,13 @@ public class VerCheck : MonoBehaviour } string copyVersionPath = Path.Combine(Application.streamingAssetsPath, "version.txt"); +#if UNITY_IPHONE + if (File.Exists(copyVersionPath)) + { + string copyVersionString = File.ReadAllText(copyVersionPath).Trim(); + } +#endif +#if UNITY_ANDROID UnityWebRequest copyRequest = UnityWebRequest.Get(copyVersionPath); yield return copyRequest.SendWebRequest(); @@ -349,13 +356,22 @@ public class VerCheck : MonoBehaviour }); yield break; } + string copyVersionString = copyRequest.downloadHandler.text.Trim(); +#endif bool isSame = copyVersionString.Equals(server_version.ToString()); if (isSame) { viewBtn_showWait.title = "正在解压资源..."; string copyZipPath = Path.Combine(Application.streamingAssetsPath, "Pack.byte"); +#if UNITY_IPHONE + if (File.Exists(copyZipPath)) + { + byte[] zipData = File.ReadAllBytes(copyZipPath); + } +#endif +#if UNITY_ANDROID UnityWebRequest copyZipRequest = UnityWebRequest.Get(copyZipPath); yield return copyZipRequest.SendWebRequest(); @@ -369,6 +385,7 @@ public class VerCheck : MonoBehaviour } byte[] zipData = copyZipRequest.downloadHandler.data; +#endif string zipString = Path.Combine(Application.persistentDataPath, "Pack.byte"); File.WriteAllBytes(zipString, zipData);