主要功能 Preview of 2018.3 features - Unity Forum
粒子系统升级 Particle System Improvements - Google 文档
官方升级文档草案 DRAFT Upgrade Guide 2018.3 - Google 文档
版本文件 ProjectSettings/ProjectVersion.txt
1 2 3 4 5 |
The Unity Package Manager now uses the "Packages" sub-folder of the project to persist package configuration and future package management-related features. The project manifest ("manifest.json") from the "UnityPackageManager" folder was moved to the "Packages" folder. You can safely delete the "UnityPackageManager" folder if it is no longer needed, and update your source control configuration accordingly. |
Packages 结构发生变化。
删除过期失效且不更新的插件。
导入过程中产生大量错误、警告与信息,按照错误、警告、信息依次处理。
发现新版本存在 Bug:修改 Editor 目录下脚本并不会显示非 Editor 目录下脚本的编译错误,只有手动重新 Reimport 普通脚本触发编译错误才可以正确报错。
1 2 3 |
Cannot access protected member `UnityEngine.RuntimeAnimatorController.RuntimeAnimatorController()' via a qualifier of type `UnityEngine.RuntimeAnimatorController'. The qualifier must be of type `ChapterAnimItem' or derived from it error CS1540 |
去除初始化 new RuntimeAnimatorController()
调用。
1 2 3 |
`TextureCompressionQuality' is an ambiguous reference between `UnityEngine.TextureCompressionQuality' and `UnityEditor.TextureCompressionQuality' error CS0104 |
直接引用 UnityEditor 命名空间:using TextureCompressionQuality = UnityEditor.TextureCompressionQuality;
1 2 3 |
Component could not be loaded when loading game object. Cleaning up! Object GameObject (named 'XXXXXX') has multiple entries of the same Object component. Removing it! |
原有粒子特效 Prefab 中存在着废弃的粒子组件:
以上粒子相关组件在 2018.1 标记为已废弃,在 2018.3 中被完全被移除。
1 2 3 |
warning CS0618: `UnityEngine.Object.DestroyObject(UnityEngine.Object)' is obsolete: `use Object.Destroy instead.' warning CS0618: `UnityEngine.TouchScreenKeyboard.done' is obsolete: `Property done is deprecated, use status instead' warning CS0618: `UnityEngine.TouchScreenKeyboard.wasCanceled' is obsolete: `Property wasCanceled is deprecated, use status instead.' |
修正过期 API
由于 2018.3 支持嵌套 Prefab,因此 API 发生较大变化,需要额外处理
API 对应升级列表
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
PrefabUtility.GetPrefabParent PrefabUtility.GetCorrespondingObjectFromSource PrefabUtility.ReplacePrefab PrefabUtility.SavePrefabAsset PrefabUtility.CreatePrefab PrefabUtility.SaveAsPrefabAsset PrefabUtility.GetPrefabType PrefabUtility.GetPrefabAssetType PrefabUtility.GetPrefabInstanceStatus PrefabUtility.FindPrefabRoot Use GetOutermostPrefabInstanceRoot if source is a Prefab instance or source.transform.root.gameObject if source is a Prefab Asset object. |
1 2 3 |
Cannot implicitly convert type `UnityEditor.Build.Reporting.BuildReport' to `string' error CS0029 |
BuildPipeline.BuildPlayer 的返回值由 string 改为 BuildReport,根据需要取其中的字段使用即可。
1 |
Particle System is trying to spawn on a mesh with zero surface area |
Fading in an entire particle system - Unity Forum
It means your mesh has zero surface area and you are not using vertex placement mode. Does your mesh have any triangles? Surface area is the total surface area of all triangles on your mesh. Either switch to vertex mode or add some triangles.
实际原因是因为 ParticleSystem 中 ShapeModule 要求引用的 Mesh 必须开启 Read/Write 选项。
1 |
Mesh DLoadingPage_CameraFlashBase requires Read/Write Enabled to be set in the importer to work on the particle system shape module |
Particle System 升级后需要启用 Mesh 的 Read/Write Enabled 开关,需要编写脚本处理这种情况。
注意:需要关闭 AssetPostprocessor 中的禁用 Read/Write 代码。
增加查找出问题特效脚本:
|
|
1 2 |
Failed getting available Android API levels. Make sure your android sdk tools version is 25 or higher and you have internet connection. UnityEditor.Android. |
构建时报错,按照提示,直接点击 Update 按钮升级 Android SDK 即可。
iOS 构建完成后报告链接错误,仔细检查后发现链接库被 Git LFS 管理,在检出时并未被还原为二进制文件,而是保留文本指针内容。
执行 git lfs checkout
命令修正此问题。
Unity 2018.3 中终于把 meta 文件中无用的
1 2 |
timeCreated: 1523361353 licenseType: Pro |
两个字段删除了,实际上 timeCreated 并不是指资源创建的时间,而是资源修改的时间。
1 2 3 |
NullReferenceException: Object reference not set to an instance of an object SuperTextMesh.OnValidate () (at Assets/Plugins/Clavian/SuperTextMesh/Scripts/SuperTextMesh.cs:1012) |
SuperTextMesh 需要升级
1 2 |
ExecuteAlways ExecuteInEditMode |
两个属性有变化,需要更新
1 2 3 |
HasCoreStatsInBuild is only valid when called while building the player! UnityEditor.BuildPipeline:BuildAssetBundles(String, BuildAssetBundleOptions, BuildTarget) (at ?) |
构建 AssetBundle 时有错误,不确定是由什么引起的
1 2 3 4 5 |
Your multi-scene setup may be improved by tending to the following issues: Multiple scenes baked with Auto enabled can appear differently in Play mode when reloading them. Consider disabling Auto and rebaking. Your current multi-scene setup has inconsistent Lighting settings which may lead to different lighting when loading scenes individually or in a different order! Consider homogenizing the following: 1/2 scenes have Auto baking enabled. |
统一所有场景的光照设置
1 |
`UnityEditor.AndroidBuildSystem.Internal' is obsolete: `Internal build system is deprecated. Please use Gradle instead' |
需要转换项目到 Gradle
1 |
warning CS0618: `UnityEngine.WWW' is obsolete: `Use UnityWebRequest, a fully featured replacement which is more efficient and has additional features' |
暂时禁用 WWW 过期警告,需要升级到新版本 API。