Exemple #1
0
        /// <summary>
        /// 异步初始化
        /// </summary>
        public IEnumerator InitializeAsync(bool simulationOnEditor)
        {
            if (simulationOnEditor)
            {
                yield break;
            }

            // 解析APP里的补丁清单
            string         filePath   = AssetPathHelper.MakeStreamingLoadPath(PatchDefine.PatchManifestBytesFileName);
            string         url        = AssetPathHelper.ConvertToWWWPath(filePath);
            WebDataRequest downloader = new WebDataRequest(url);

            yield return(downloader.DownLoad());

            if (downloader.States == EWebRequestStates.Success)
            {
                _patchManifest = new PatchManifest();
                _patchManifest.Parse(downloader.GetData());
                downloader.Dispose();
            }
            else
            {
                throw new System.Exception($"Fatal error : Failed download file : {url}");
            }
        }
 public void ParseWebPatchManifest(string fileContent)
 {
     if (WebPatchManifest != null)
     {
         throw new Exception("Should never get here.");
     }
     WebPatchManifest = new PatchManifest();
     WebPatchManifest.Parse(fileContent);
 }
 public void ParseWebPatchManifest(byte[] fileData)
 {
     if (WebPatchManifest != null)
     {
         throw new Exception("Should never get here.");
     }
     WebPatchManifest = new PatchManifest();
     WebPatchManifest.Parse(fileData);
 }