Unity中的StrippingLevel
来源:互联网 发布:mac连接投影仪快捷键 编辑:程序博客网 时间:2024/05/20 23:07
StrippingLevel的作用
StrippingLevel是用来减少打包出来的player的体积
如图。第一个是选择Strip Byte Code的包的大小,第一个是选择的Disabled的打出来的包的大小,明显的Strip Byte Code的包体积小于没有进行剥离的包,大概1M。
StrippingLevel选项的副作用
使用Stripping Level需要注意的是,有可能会导致一些API执行过程中报异常,比如选择Strip Byte Code下,HttpWebRequest就会报异常:System.NotSupportedException,原因是被Strip出去了。
/// <summary> /// 获取下载文件的大小 /// </summary> /// <returns>The length.</returns> /// <param name="url">URL.</param> public static long GetLength (string url) { HttpWebRequest requet = HttpWebRequest.Create(url) as HttpWebRequest; requet.Method = "HEAD"; HttpWebResponse response = requet.GetResponse() as HttpWebResponse; UnityEngine.Debug.LogFormat("GetLength StatusCode:{0}", response.StatusCode); return response.ContentLength; }
利用link.xml手动排除不能被剥离的的类
<linker> <assembly fullname="mscorlib"> <type fullname="System.Reflection" preserve="all"/> <type fullname="System.Security.Cryptography" preserve="all"/> <type fullname="System.Runtime.CompilerServices" preserve="all"/> <type fullname="System.Runtime.InteropServices" preserve="all"/> <type fullname="System.Diagnostics" preserve="all"/> <type fullname="System.Security" preserve="all"/> <type fullname="System.Security.Permissions" preserve="all"/> </assembly></linker>
参考链接:https://docs.unity3d.com/Manual/iphone-playerSizeOptimization.html
阅读全文
1 0
- Unity中的StrippingLevel
- 【Unity编程】Unity中的基本概念
- Unity中的中文显示
- Unity中的线程
- Unity 中的数学知识
- Unity中的网络编程
- 理解Unity中的Interception
- Unity中的调试
- Unity中的调试
- Unity中的GUI编程
- Unity中的网络
- Unity中的关节
- unity中的MonoBehaviour.OnMouseDown()
- 关于unity中的类
- 关于Unity 中的四元数
- unity中的事件函数
- unity中的destroy
- Unity中的序列化
- hive优化-文件格式-rcfile-textfile-seqfile
- 描述 有一楼梯共m级,刚开始时你在第一级,若每次只能跨上一级或二级,要走上第m级,共有多少走法? 注:规定从一级到一级有0种走法。
- 书籍推荐
- MySQL存储过程中,定义变量有两种方式
- 8月22日训练
- Unity中的StrippingLevel
- android 7.0 制作ota差分包
- Java设计模式之模板方法模式
- textview里放入图片
- Incorrect string value: '\xE7\xA8\x8B\xE5\xBA\x8F...' for column 'course' at row 1
- Caesar 密码
- 我们一直在默契成长
- 学习笔记| AS入门(五) 高级控件篇(上)
- Centos宽带链接ADSL-pppoe