【发布时间】:2017-11-12 10:48:04
【问题描述】:
我正在尝试优化我的游戏的文件大小,尤其是 android 版本。我已经优化了资产并将构建剥离级别设置为使用 micro mscorlib。但是,查看 Editor.log 会发现 DLL 仍占 50% 以上:
Textures 2.7 mb 35.7%
Meshes 80.5 kb 1.0%
Animations 0.0 kb 0.0%
Sounds 0.8 kb 0.0%
Shaders 98.2 kb 1.3%
Other Assets 177.9 kb 2.3%
Levels 110.0 kb 1.4%
Scripts 447.4 kb 5.8%
Included DLLs 3.9 mb 52.2%
File headers 26.2 kb 0.3%
Complete size 7.5 mb 100.0%
3.9mb 似乎有点多,所以我查看了实际添加了哪些 DLL。我发现了这个:
Mono dependencies included in the build
Dependency assembly - Mono.Security.dll
Dependency assembly - System.Core.dll
Dependency assembly - System.dll
Dependency assembly - mscorlib.dll
Dependency assembly - UnityEngine.UI.dll
Dependency assembly - UnityEngine.Networking.dll
Dependency assembly - UnityEngine.Analytics.dll
Dependency assembly - Assembly-CSharp.dll
Dependency assembly - Assembly-UnityScript-firstpass.dll
Dependency assembly - Assembly-UnityScript.dll
这看起来可以改进很多。我不使用 UnitScript,因此 Assembly-UnityScript-firstpass.dll 和 Assembly-UnityScript.dll 应该已过时。我也不使用网络或分析,所以这些也可以删除。不确定 Mono.Security.dll 是做什么的,或者 UnityEngine.UI.dll 是否真的需要。 那么,知道了这一点,我该如何摆脱这些看似不必要的 DLL 呢?
【问题讨论】:
-
哇!!我在 emtpy-sample 场景项目中获得了 include.dll 13mb。
标签: unity3d optimization dll unity5 game-engine