Beispiel #1
0
 /// <summary>
 /// 每次更新好一个文件后,把更新到的新的资源列表存储到内存中,并存储到本地
 /// </summary>
 /// <param name="record"></param>
 public static void SaveDownloadedResList(AssetBundleAsset record)
 {
     if (downloadedResList != null)
     {
         if (downloadedResList.assets == null)
         {
             downloadedResList.assets = new List <AssetBundleAsset>();
         }
         var res = downloadedResList.assets.Where(p => p.assetName.Equals(record.assetName)).ToList();
         if (res.Count == 0)
         {
             downloadedResList.assets.Add(record);
         }
         else
         {
             res.First().crc = record.crc;
         }
         string jsonContent = downloadedResList.ToNewtonJson();
         downloadedResListFilePath.WriteTextAssetContentStr(jsonContent);
     }
 }
Beispiel #2
0
        /// <summary>
        /// 更新好后把服务器中的资源列表存储到内存中,并存储到本地
        /// </summary>
        /// <param name="netResList"></param>
        public static void SaveLocalResList(AssetBundleAssetList netResList)
        {
            string jsonContent = netResList.ToNewtonJson();

            LocalResListFilePath.WriteTextAssetContentStr(jsonContent);
        }