private static void ProcessTableConfig(AssetDataTable table, string folder) { AssetDataPackage group = null; DirectoryInfo direInfo = new DirectoryInfo(folder); FileInfo[] fileInfos = direInfo.GetFiles(); if (fileInfos == null || fileInfos.Length == 0) { return; } for (int i = 0; i < fileInfos.Length; ++i) { FileInfo info = fileInfos[i]; if (AssetFileFilter.IsConfigTable(info.FullName)) { string md5 = GetMD5HashFromFile(info.FullName); long buildTime = DateTime.Now.Ticks;//info.LastWriteTime.Ticks; table.AddAssetBundleName(ProjectPathConfig.tableFolder + info.Name, null, md5, (int)info.Length, buildTime, out group); } } table.Dump(); }
private static void ProcessAssetBundleRes(AssetDataTable table, string[] abNames) { AssetDataPackage group = null; int abIndex = -1; AssetDatabase.RemoveUnusedAssetBundleNames(); if (abNames == null) { abNames = AssetDatabase.GetAllAssetBundleNames(); } if (abNames != null && abNames.Length > 0) { for (int i = 0; i < abNames.Length; ++i) { string abPath = Application.dataPath + "/" + ProjectPathConfig.exportRootFolder + abNames[i]; string[] depends = AssetDatabase.GetAssetBundleDependencies(abNames[i], false); FileInfo info = new FileInfo(abPath); if (!info.Exists) { continue; } string md5 = GetMD5HashFromFile(abPath); long buildTime = DateTime.Now.Ticks; //info.LastWriteTime.Ticks; abIndex = table.AddAssetBundleName(abNames[i], depends, md5, (int)info.Length, buildTime, out group); if (abIndex < 0) { continue; } //Log.i("MD5:" + GetMD5HashFromFile(abPath)); string[] assets = AssetDatabase.GetAssetPathsFromAssetBundle(abNames[i]); foreach (var cell in assets) { if (cell.EndsWith(".unity")) { group.AddAssetData(new AssetData(AssetPath2Name(cell), eResType.kABScene, abIndex)); } else { group.AddAssetData(new AssetData(AssetPath2Name(cell), eResType.kABAsset, abIndex)); } } } } table.Dump(); }
private static void ProcessAssetBundleRes(AssetDataTable table) { AssetDataGroup group = null; int abIndex = table.AddAssetBundleName(FrameworkConfigData.ABMANIFEST_AB_NAME, null, out group); if (abIndex > 0) { group.AddAssetData(new AssetData(FrameworkConfigData.ABMANIFEST_ASSET_NAME, eResType.kABAsset, abIndex, null)); } AssetDatabase.RemoveUnusedAssetBundleNames(); string[] abNames = AssetDatabase.GetAllAssetBundleNames(); if (abNames != null && abNames.Length > 0) { for (int i = 0; i < abNames.Length; ++i) { string[] depends = AssetDatabase.GetAssetBundleDependencies(abNames[i], false); abIndex = table.AddAssetBundleName(abNames[i], depends, out group); if (abIndex < 0) { continue; } string[] assets = AssetDatabase.GetAssetPathsFromAssetBundle(abNames[i]); foreach (var cell in assets) { if (cell.EndsWith(".unity")) { group.AddAssetData(new AssetData(AssetPath2Name(cell), eResType.kABScene, abIndex, abNames[i])); } else { group.AddAssetData(new AssetData(AssetPath2Name(cell), eResType.kABAsset, abIndex, abNames[i])); } } } } table.Dump(); }