Proposal: don't report MonoScripts as potential duplicates
还没有人认领这个 Issue。
评估
调研方向
Start by reading the implementation of view_potential_duplicates and how it gathers content types; the issue does not name a file or test. Compare its MonoScript results with the checked-in LeadingEdgeBuilds/AssetBundles data, where DirectAudioClipReference appears twice. Done means the view no longer reports expected per-file MonoScript copies as potential duplicates, with the issue's Unity change still undecided.
由索引模型根据 Issue 内容生成。
描述
Proposal - depends on a Unity change that is not yet decided.
A change currently under review in Unity would stop Content Directory builds from collecting all MonoScripts into one shared content file. Instead, each content file would embed its own copy of every MonoScript it references. At load time Unity repoints the hosts to one shared MonoScript per class, so the embedded copies are expected duplication by design, not wasted content.
I analyzed a local build with that change (plus local fixes for SerializedFile v27 and ContentLayout v4). Most of UnityDataTool handles it fine: monoscript_view and script_object_view link each MonoScript to its host in the same file. The one noisy result is view_potential_duplicates, which lists the per-file copies as duplicated content:
instances name type total_size size in_files
2 LoadableAudioClipReference MonoScript 216 108 6150b4ed....cf, e71b9429....cf
In a real project with many ScriptableObject or prefab content files, this would add a MonoScript row for almost every script class and hide the real duplicates.
Proposal
If Unity ships embedded MonoScripts, exclude MonoScript from view_potential_duplicates, or move it to a separate view or note.
AssetBundle builds already work this way: each bundle carries the MonoScripts it uses, and the view already lists them. In the checked-in LeadingEdgeBuilds/AssetBundles data, DirectAudioClipReference appears twice. So the filter would also remove existing noise from AssetBundle analysis, even if the Unity change doesn't land.
The cost of the embedding (mostly the MonoScript TypeTree in each file's header, about 1 KB per file uncompressed in my test) would then be better reported through TypeTree overhead reporting (#127) than through the duplicates view.
Leaving this open until the Unity change is decided. If it doesn't land, the AssetBundle case alone may still justify the change.
- 主要语言
- C#
- 星标
- 841
- 派生
- 75
- 平均合并
- 1 天 7 小时
- 30 天内合并 PR
- 3
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Unity-Technologies/UnityDataTools 的其他 Issue
-
enhancement
难度 2/5 1-3 小时 新手友好度 68/100
Unity-Technologies/UnityDataTools#116 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 3/5 1-2 天 新手友好度 56/100
-
难度 4/5 3-5 天 新手友好度 48/100
-
难度 4/5 3-5 天 新手友好度 45/100
查看 Unity-Technologies/UnityDataTools 的全部 Issue
相似的 Issue
-
type:task ux
难度 2/5 1-3 小时 新手友好度 72/100
elsa-workflows/elsa-foundation#5253 ·
维护者通常 1 天内回复