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);