| | |
| | | using System; |
| | | using System.Text.RegularExpressions; |
| | | using LitJson; |
| | | using Cysharp.Threading.Tasks; |
| | | |
| | | |
| | | public class InGameDownLoad : SingletonMonobehaviour<InGameDownLoad> |
| | |
| | | |
| | | DownloadHotMgr.Instance.Prepare(); |
| | | |
| | | var versionConfig = VersionConfig.config; |
| | | |
| | | if (null == versionConfig) |
| | | { |
| | | // 如果前面都没获取到那一定是哪里出问题了 从这里打断 |
| | | throw new Exception("VersionConfig is null when AssignTasks, game will pause here"); |
| | | } |
| | | |
| | | for (int i = 0; i < this.assets.Count; i++) |
| | | { |
| | | var assetVersion = this.assets[i]; |
| | | totalSize += assetVersion.size;//统计资源总大小 |
| | | |
| | | //添加下载任务 |
| | | var remoteURL = StringUtility.Concat(VersionUtility.Instance.versionInfo.GetResourcesURL(VersionConfig.Get().branch), Language.fixPath, "/", assetVersion.relativePath); |
| | | var remoteURL = StringUtility.Concat(VersionUtility.Instance.versionInfo.GetResourcesURL(versionConfig.branch), Language.fixPath, "/", assetVersion.relativePath); |
| | | var localURL = StringUtility.Concat(ResourcesPath.Instance.ExternalStorePath, assetVersion.relativePath); |
| | | DownloadHotMgr.Instance.AddTask(new DownloadHotTask(remoteURL, localURL, assetVersion)); |
| | | } |