{"id":13662561,"url":"https://github.com/akof1314/AssetBundleReporter","last_synced_at":"2025-04-25T10:32:06.615Z","repository":{"id":53698128,"uuid":"95758354","full_name":"akof1314/AssetBundleReporter","owner":"akof1314","description":"Unity AssetBundle Reporter","archived":false,"fork":false,"pushed_at":"2022-10-13T11:11:31.000Z","size":2231,"stargazers_count":152,"open_issues_count":2,"forks_count":51,"subscribers_count":5,"default_branch":"2018","last_synced_at":"2025-04-08T06:42:23.641Z","etag":null,"topics":["assetbundle","unity"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/akof1314.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-29T08:55:29.000Z","updated_at":"2025-03-31T14:07:54.000Z","dependencies_parsed_at":"2023-01-20T00:32:20.953Z","dependency_job_id":null,"html_url":"https://github.com/akof1314/AssetBundleReporter","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akof1314%2FAssetBundleReporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akof1314%2FAssetBundleReporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akof1314%2FAssetBundleReporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akof1314%2FAssetBundleReporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akof1314","download_url":"https://codeload.github.com/akof1314/AssetBundleReporter/tar.gz/refs/heads/2018","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250798278,"owners_count":21489054,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["assetbundle","unity"],"created_at":"2024-08-02T05:02:02.158Z","updated_at":"2025-04-25T10:32:05.604Z","avatar_url":"https://github.com/akof1314.png","language":"C#","funding_links":[],"categories":["C\\#"],"sub_categories":[],"readme":"# Unity AssetBundle Reporter\nUnity AssetBundle 冗余检测与资源分析\n![](http://img.blog.csdn.net/20170930130444977)\n\n## 原因\n在使用 Unity 进行开发项目时，通常使用 AssetBundle 来进行资源打包，虽然在 Unity 5.x 版本里提供了更加智能的依赖自动管理，即如果依赖的资源没有显式设置 AssetBundle 名称，那么就会被隐式地打包到同一个 AssetBundle 包里面。而如果已经设置的话，那么就会自动生成依赖关系。\n\n那么当被依赖的资源没有独立打包时，而此时又存在两个或以上 AssetBundle 依赖此资源的话，这个资源就会被同时打包到这些 AssetBundle 包里面，造成资源冗余，增大 AssetBundle 包的体积，增加游戏加载 AssetBundle 时所需的内存。\n\n于是，检测 AssetBundle 资源的冗余，才好方便对其进行优化。检测冗余可以在未打包前对将要打包的资源做分析，但是这无法完全保证打包之后的 AssetBundle 完全无冗余，一是分析时无法保证正确无冗余，二是引用的内置资源无法剔除冗余，所以对打包之后的 AssetBundle 包进行检测才真正检查到所有的冗余。\n\n## 实现过程\n详见 http://blog.csdn.net/akof1314/article/details/78141789\n\n## 支持平台\n目前仅支持 Windows 平台，Mac 平台需自行解决 gdiplus.dll 报错问题。\n\n## 使用说明\n将插件包导入到工程，打包 AssetBundle 之后，调用检测的接口，如下所示：\n```\n/// \u003csummary\u003e\n/// 分析打印 AssetBundle\n/// \u003c/summary\u003e\n/// \u003cparam name=\"bundlePath\"\u003eAssetBundle 文件所在文件夹路径\u003c/param\u003e\n/// \u003cparam name=\"outputPath\"\u003eExcel 报告文件保存路径\u003c/param\u003e\n/// \u003cparam name=\"completed\"\u003e分析打印完毕后的回调\u003c/param\u003e\npublic static void AnalyzePrint(string bundlePath, string outputPath, UnityAction completed = null)\n```\n传入所需的参数即可，等待输出报告。另外注意一点，打包完 AssetBundle 就立即检测，这样才能在分析 AssetBundle 的时候，获取到正确的自定义脚本类信息，才能分析完全。过后再检测的话，自定义的脚本类可能被其他人所修改，那么就无法分析正确。Unity 5.4+ 支持场景资源分析，Unity 4.X ~ Unity 5.3 只支持非场景资源分析。","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakof1314%2FAssetBundleReporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakof1314%2FAssetBundleReporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakof1314%2FAssetBundleReporter/lists"}