private static void ProcessAssetBundleRes(ResDatas table) { AssetDatabase.RemoveUnusedAssetBundleNames(); var abNames = AssetDatabase.GetAllAssetBundleNames(); if (abNames != null && abNames.Length > 0) { foreach (var abName in abNames) { var depends = AssetDatabase.GetAssetBundleDependencies(abName, false); AssetDataGroup group; var abIndex = table.AddAssetBundleName(abName, depends, out @group); if (abIndex < 0) { continue; } var assets = AssetDatabase.GetAssetPathsFromAssetBundle(abName); foreach (var cell in assets) { @group.AddAssetData(cell.EndsWith(".unity") ? new AssetData(AssetPath2Name(cell), ResType.ABScene, abIndex, abName) : new AssetData(AssetPath2Name(cell), ResType.ABAsset, abIndex, abName)); } } } }
public static ResDatas BuildDataTable() { Log.I("Start BuildAssetDataTable!"); var resDatas = ResDatas.Create(); ProcessAssetBundleRes(resDatas); return(resDatas); }
public static void BuildDataTable() { Log.I("Start BuildAssetDataTable!"); ResDatas table = ResDatas.Create(); ProcessAssetBundleRes(table); var filePath = (FilePath.StreamingAssetsPath + ResKitUtil.RELATIVE_AB_ROOT_FOLDER).CreateDirIfNotExists() + ResKitUtil.EXPORT_ASSETBUNDLE_CONFIG_FILENAME; table.Save(filePath); AssetDatabase.Refresh(); }