unity——打包问题积累

案例一:

背景:打包时提示”Error building Player because scripts had compiler errors“和其他代码编译不过的异常提示(”/ToLua/ToLua/Editor/ToLuaMenu.cs(26,7): error CS0246: The type or namespace name `UnityEditor' could not be found“),代码跑到”       BuildPipeline.BuildStreamedSceneAssetBundle“就中断了。

原因:在非Edtor目录下使用了UnityEditor代码(看起来在Plugin中嵌套Editor文件夹,Editor文件夹不会起作用的)。
解决方案:
将使用到UnityEditor相关的代码放到未嵌套在Plugins下的Editor目录下
(实际上Assets\Plugins\LuaPlugin\ToLua\Editor挪到Assets\Editor\ToLua)
参考:
http://answers.unity3d.com/questions/396311/error-while-build-app-game-with-assetbundle-menu-c.html
http://answers.unity3d.com/questions/316805/unityeditor-namespace-not-found.html
同异常的其他情景:
https://www.reddit.com/r/Unity3D/comments/27i9lx/using_unity_integration_package_for_oculus_rift/
http://blog.csdn.net/wldrswgzmb/article/details/50522247


转载于:https://www.cnblogs.com/xiaobalang/p/6704318.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值