public static void FillWorksheet(ExcelWorksheet ws) { int startRow = 2; List <AssetBundleFileInfo> infos = AssetBundleFilesAnalyze.GetAllAssetBundleFileInfos(); foreach (var info in infos) { ws.Cells[startRow, 1].Value = info.name + " 所包含的具体资源"; using (var range = ws.Cells[startRow, 1, startRow, 4]) { range.Merge = true; range.Style.Font.Bold = true; range.Style.Fill.PatternType = ExcelFillStyle.Solid; range.Style.Fill.BackgroundColor.SetColor(ColorTranslator.FromHtml("#BDD7EE")); } info.detailHyperLink.ReferenceAddress = ws.Cells[startRow, 1].FullAddress; FillAssetByType(info, AssetFileInfoType.mesh, ws, ref startRow); FillAssetByType(info, AssetFileInfoType.material, ws, ref startRow); FillAssetByType(info, AssetFileInfoType.texture2D, ws, ref startRow); FillAssetByType(info, AssetFileInfoType.sprite, ws, ref startRow); FillAssetByType(info, AssetFileInfoType.shader, ws, ref startRow); FillAssetByType(info, AssetFileInfoType.animatorController, ws, ref startRow); FillAssetByType(info, AssetFileInfoType.animatorOverrideController, ws, ref startRow); FillAssetByType(info, AssetFileInfoType.animationClip, ws, ref startRow); FillAssetByType(info, AssetFileInfoType.audioClip, ws, ref startRow); FillAssetByType(info, AssetFileInfoType.monoScript, ws, ref startRow); FillAssetDepends(info, ws, ref startRow); startRow += 6; } }
public static void FillWorksheet(ExcelWorksheet ws) { int startRow = 3; List <AssetBundleFileInfo> infos = AssetBundleFilesAnalyze.GetAllAssetBundleFileInfos(); foreach (var info in infos) { int colIndex = 1; ws.Cells[startRow, colIndex].Value = info.name; info.detailHyperLink = new ExcelHyperLink(String.Empty, info.name); ws.Cells[startRow, colIndex++].Hyperlink = info.detailHyperLink; ws.Cells[startRow, colIndex++].Value = info.size; int count = info.allDepends.Length; if (count > 0) { ws.Cells[startRow, colIndex].Value = count; } colIndex++; count = 0; foreach (var asset in info.assets) { if (asset.includedBundles.Count > 1 && asset.type != AssetFileInfoType.monoScript) { count++; } } if (count > 0) { ws.Cells[startRow, colIndex].Value = count; } colIndex++; count = info.GetAssetCount(AssetFileInfoType.mesh); if (count > 0) { ws.Cells[startRow, colIndex].Value = count; } colIndex++; count = info.GetAssetCount(AssetFileInfoType.material); if (count > 0) { ws.Cells[startRow, colIndex].Value = count; } colIndex++; count = info.GetAssetCount(AssetFileInfoType.texture2D); if (count > 0) { ws.Cells[startRow, colIndex].Value = count; } colIndex++; count = info.GetAssetCount(AssetFileInfoType.sprite); if (count > 0) { ws.Cells[startRow, colIndex].Value = count; } colIndex++; count = info.GetAssetCount(AssetFileInfoType.shader); if (count > 0) { ws.Cells[startRow, colIndex].Value = count; } colIndex++; count = info.GetAssetCount(AssetFileInfoType.animationClip); if (count > 0) { ws.Cells[startRow, colIndex].Value = count; } colIndex++; count = info.GetAssetCount(AssetFileInfoType.audioClip); if (count > 0) { ws.Cells[startRow, colIndex].Value = count; } startRow++; } ws.Cells[1, 1].Value = ws.Cells[1, 1].Value + " (" + infos.Count + ")"; }