|
报错展示
在编译器中运行完好,没什么问题,但是打包时会报这些错,
解决方案
找到Xlua路径Assets/XLua/Editor/ExampleConfig.cs这个脚本,我们会看到有一个BlackList,至于BlackList是做什么的,在Xlua的教程文档里有解释:
如果你不要生成一个类型的一些成员的适配代码,你可以通过这个配置来实现。
标签方式比较简单,对应的成员上加就可以了。
由于考虑到有可能需要把重载函数的其中一个重载列入黑名单,配置方式比较复杂,类型是List<List>,对于每个成员,在第一层List有一个条目,第二层List是个string的列表,第一个string是类型的全路径名,第二个string是成员名,如果成员是一个方法,还需要从第三个string开始,把其参数的类型全路径全列出来。
例如:- [BlackList]publicstatic List<List<string>> BlackList =newList<List<string>>(){newList<string>(){"UnityEngine.GameObject","networkView"},newList<string>(){"System.IO.FileInfo","GetAccessControl","System.Security.AccessControl.AccessControlSections"},};
复制代码 这里我们报错的几个方法加入到BlackList中:
如下:- [BlackList]publicstatic List<List<string>> BlackList =newList<List<string>>(){newList<string>(){"System.Xml.XmlNodeList","ItemOf"},newList<string>(){"UnityEngine.WWW","movie"},
- #ifUNITY_WEBGLnewList<string>(){"UnityEngine.WWW","threadPriority"},
- #endif
- newList<string>(){"UnityEngine.Texture2D","alphaIsTransparency"},newList<string>(){"UnityEngine.Security","GetChainOfTrustValue"},newList<string>(){"UnityEngine.CanvasRenderer","onRequestRebuild"},newList<string>(){"UnityEngine.Light","areaSize"},newList<string>(){"UnityEngine.Light","lightmapBakeType"},newList<string>(){"UnityEngine.WWW","MovieTexture"},newList<string>(){"UnityEngine.WWW","GetMovieTexture"},newList<string>(){"UnityEngine.Light","SetLightDirty"},newList<string>(){"UnityEngine.Light","shadowRadius"},newList<string>(){"UnityEngine.Light","shadowAngle"},newList<string>(){"UnityEngine.Light","shadowRadius"},newList<string>(){"UnityEngine.AnimatorOverrideController","PerformOverrideClipListCleanup"},
- #if!UNITY_WEBPLAYERnewList<string>(){"UnityEngine.Application","ExternalEval"},
- #endif
- newList<string>(){"UnityEngine.GameObject","networkView"},//4.6.2 not supportnewList<string>(){"UnityEngine.Component","networkView"},//4.6.2 not supportnewList<string>(){"System.IO.FileInfo","GetAccessControl","System.Security.AccessControl.AccessControlSections"},newList<string>(){"System.IO.FileInfo","SetAccessControl","System.Security.AccessControl.FileSecurity"},newList<string>(){"System.IO.DirectoryInfo","GetAccessControl","System.Security.AccessControl.AccessControlSections"},newList<string>(){"System.IO.DirectoryInfo","SetAccessControl","System.Security.AccessControl.DirectorySecurity"},newList<string>(){"System.IO.DirectoryInfo","CreateSubdirectory","System.String","System.Security.AccessControl.DirectorySecurity"},newList<string>(){"System.IO.DirectoryInfo","Create","System.Security.AccessControl.DirectorySecurity"},newList<string>(){"UnityEngine.MonoBehaviour","runInEditMode"},};
复制代码
主要就是将报错的几个方法加入到BlackList中,然后
先清理之前生成的代码
接着再重新生成下代码:
接下来重新打包就可以愉快的玩耍了 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
×
|