| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.IO; |
| | | using Cysharp.Threading.Tasks; |
| | | using UnityEngine; |
| | | |
| | | public class CheckAssetValidTask : LaunchTask |
| | |
| | | LaunchInHot.m_CurrentStage = LaunchStage.CheckAsset; |
| | | duration = Mathf.Max(0.5f, expectTime); |
| | | |
| | | ServerListCenter.Instance.RequestJumpUrl(); |
| | | ServerListCenter.Instance.RequestJumpUrl().Forget(); |
| | | |
| | | // TODO YYL |
| | | // OperationLogCollect.Instance.RecordLauchEvent(2); |
| | | // OperationLogCollect.Instance.RecordEvent(2); |
| | | |
| | | if (VersionUtility.Instance.NeedDownAsset()) |
| | | VersionConfig.GetAsync().ContinueWith(config => |
| | | { |
| | | var remoteURL = StringUtility.Concat(VersionUtility.Instance.versionInfo.GetResourcesURL(VersionConfig.Get().branch), Language.fixPath, "/config/PriorBundle.txt"); |
| | | var localURL = StringUtility.Concat(ResourcesPath.Instance.ExternalStorePath, "config/PriorBundle.txt"); |
| | | var downloadTask = new DownloadHotTask(remoteURL, localURL); |
| | | downloadTask.BeginDownload(AssetVersionUtility.OnDownLoadPriorBundle); |
| | | if (VersionUtility.Instance.NeedDownAsset()) |
| | | { |
| | | var remoteURL = StringUtility.Concat(VersionUtility.Instance.versionInfo.GetResourcesURL(config.branch), Language.fixPath, "/config/PriorBundle.txt"); |
| | | var localURL = StringUtility.Concat(ResourcesPath.Instance.ExternalStorePath, "config/PriorBundle.txt"); |
| | | var downloadTask = new DownloadHotTask(remoteURL, localURL); |
| | | downloadTask.BeginDownload(AssetVersionUtility.OnDownLoadPriorBundle); |
| | | |
| | | |
| | | remoteURL = StringUtility.Concat(VersionUtility.Instance.versionInfo.GetResourcesURL(VersionConfig.Get().branch), Language.fixPath, $"/config/{VersionConfig.Get().appId}OPConfig.txt"); |
| | | localURL = StringUtility.Concat(ResourcesPath.Instance.ExternalStorePath, "config/OPConfig.txt"); |
| | | var downloadTask2 = new DownloadHotTask(remoteURL, localURL); |
| | | downloadTask2.BeginDownload(AssetVersionUtility.OnDownLoadOPConfig); |
| | | //AssetVersionUtility.GetAssetVersionFile(); |
| | | done = false; |
| | | progress = 0f; |
| | | } |
| | | else |
| | | { |
| | | //if (Application.isEditor) |
| | | // PatchLoader.InitLocalPatchAsset(); |
| | | done = true; |
| | | } |
| | | remoteURL = StringUtility.Concat(VersionUtility.Instance.versionInfo.GetResourcesURL(config.branch), Language.fixPath, $"/config/{config.appId}OPConfig.txt"); |
| | | localURL = StringUtility.Concat(ResourcesPath.Instance.ExternalStorePath, "config/OPConfig.txt"); |
| | | var downloadTask2 = new DownloadHotTask(remoteURL, localURL); |
| | | downloadTask2.BeginDownload(AssetVersionUtility.OnDownLoadOPConfig); |
| | | //AssetVersionUtility.GetAssetVersionFile(); |
| | | done = false; |
| | | progress = 0f; |
| | | } |
| | | else |
| | | { |
| | | //if (Application.isEditor) |
| | | // PatchLoader.InitLocalPatchAsset(); |
| | | done = true; |
| | | } |
| | | |
| | | |
| | | }).Forget(); |
| | | |
| | | |
| | | } |
| | | |
| | | public override void End() |