第一步最简单 , 也就是选定要升到哪一个版本 , 当前为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)
具体问题具体分析 该删的删 该改的改 , 结果就是: 可以正常打开了