Unity开发实用小技巧
实用Unity开发过程中经常容易被忽略的小问题,想到了、碰到了就进行更新总结,与人方便与己方便,不会分享的攻城狮不算好农民!
1. Unity Export Package时切记去掉Include dependencies勾选
具体说明:
Export Package操作时,在弹出的Items to Export窗口中去掉Include dependencies勾选,然后进行Export操作。
原因分析:
对于带脚本的对象,unity没有能力正确分析依赖关系,绝大多数情况下unity会将工程中所有的脚本都认为是依赖项进而合并成一个包含所有脚本的程序集。所以如果取消Include dependencies勾选,导出的资源包就会包含很多不必要的脚本资源。
英文解析
Unity don’t know what scripts might be used by other scripts. All scripts are compiled into one assembly, so when you export “something” with a script attached it will always include all scripts. If you’re sure a certain script isn’t needed, you have to deselect it manually.
Usually when you want to export something you should take care of the dependencies yourself. For example required files from the Resources folders are not included automatically. Just select all objects you want to export and deselect “include dependencies”.
2. 未完待续。。。。