开启stripping遇到的问题
在手机上会遇到Could not produce class with ID***的问题,是因为Unity strip掉了用到的脚本
如果是非UnityEngine.dll中的类,会报not found的错,需要new一下改类
参考:
https://blog.csdn.net/huutu/article/details/43986079
如果是UnityEngine.dll中的
需要在link.xml添加该id的类
id:
https://docs.unity3d.com/Manual/ClassIDReference.html
方法:
https://docs.unity3d.com/Manual/IL2CPP-BytecodeStripping.html
还有是在UnityEditor.dll下的
例如
Could not produce class with ID 91(AnimatorController)
不能用link.xml,可以在Resource下建一个空的prefab,在上面挂一个AnimatorController,再打包就可以
但是为什么真机运行时会用UnityEditor.dll的类呢
https://forum.unity.com/threads/webgl-could-not-produce-class-91-engine-stripping.467181/
-——-by wolf96 2019/2/28
还没有评论,来说两句吧...