private void AddManifestAssetBundle(string dirPath) { string fileName = GetFolderName(curBuildTarget); string filePath = dirPath + fileName; AssetBundleItem item = new AssetBundleItem(); item.bundleName = fileName; item.bundleFullName = fileName; item.size = UtilTools.getFileSize(filePath); item.md5 = UtilTools.md5file(filePath); string oldMd5 = resourceData.GetMd5ByBundleName(item.bundleName); isChange = oldMd5 != item.md5; abItemList.Add(item); }
/// <summary> /// 根据文件夹,添加文件 /// </summary> /// <param name="dirPath"></param> private void AddAssetBundleItem(string dirPath, string rootPath) { string[] fileArr = Directory.GetFiles(dirPath); for (int i = 0; i < fileArr.Length; ++i) { string fileName = fileArr[i]; if (fileName.EndsWith(".meta") || fileName.EndsWith(".DS_Store") || fileName.EndsWith(".manifest")) { continue; } AssetBundleItem item = new AssetBundleItem(); item.bundleName = fileName.Substring(fileName.LastIndexOf("/") + 1); item.bundleFullName = fileName.Replace(rootPath, ""); item.size = UtilTools.getFileSize(fileName); item.md5 = UtilTools.md5file(fileName); string oldMd5 = resourceData.GetMd5ByBundleName(item.bundleName); isChange = oldMd5 != item.md5; abItemList.Add(item); } }