unity工程 升级踩坑记录 1

4 篇文章 0 订阅
3 篇文章 0 订阅

第一步最简单 , 也就是选定要升到哪一个版本 , 当前为2020年末, 决定使用2019LTS

接下来就简单了, 装一个hub 然后下载2019LTS 安装即可.

用新版本的unity打开老的项目 会有提示 : 

既然已经决定升级那自然不用犹豫 yes  upgrade 

根据工程大小不同 这个过程可能很长, 自动导入  等就行了 .

导入完成之后, 进入到新的引擎界面 , 变化很大,  尤其是有很多报错 , 必须解决. 

老版本确实太老 用的是unity4.7 版本跨越较大 ,当时用的一些插件也是比较老的 NGUI这种 ,有些api已经不再适用

例如:'RuntimePlatform.WindowsWebPlayer' is obsolete: 'WebPlayer export is no longer supported in Unity 5.4+.' 所有之前的这种引用都需要修改, 

第一步先不要这么细致 , 先尽量让工程能跑起来,  把所有 有问题的地方都注释 消除报错 常规启动 , 

嗯 这也是个不小的工作量

当中还有这样的问题 :

'C:\WorkspaceUnity\Trunk_UpEgine\Assets\Editor\System.Data.dll' and 'C:\Program Files\Unity\Hub\Editor\2019.4.16f1c1\Editor\Data\MonoBleedingEdge\lib\mono\4.7.1-api\System.Data.dll'. Remove one of the duplicate references. 

InvalidOperationException: The following game object is invoking the DontDestroyOnLoad method: DC(Clone). Notice that DontDestroyOnLoad can only be used in play mode and, as such, cannot be part of an editor script.
UIDrawCall.CreateNewDrawCall (UnityEngine.Material mat, System.Int32 size, System.Int32 layer) (at Assets/Plugins/ngui/Scripts/Internal/UIDrawCall.cs:447)
UIDrawCall.AllocDrawCall (UnityEngine.Material mat, System.Int32 size, System.Int32 layer) (at Assets/Plugins/ngui/Scripts/Internal/UIDrawCall.cs:463)
UIPanel.Fill (UnityEngine.Material mat) (at Assets/Plugins/ngui/Scripts/UI/UIPanel.cs:1002)
UIPanel.LateUpdate () (at Assets/Plugins/ngui/Scripts/UI/UIPanel.cs:1122)

具体问题具体分析 该删的删  该改的改 , 结果就是:  可以正常打开了 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值