Version: 2023.2
Upgrade to Unity 2022 LTS
Upgrade to Unity 2022.1

Upgrade to Unity 2022.2

页面大纲

渲染管线

This upgrade guide describes how to upgrade to version 2022.2 of Unity’s built-in render pipeline. To upgrade to other render pipelines to version 2022.2, see:

To upgrade other packages, refer to the documentation for the packages you are using.

Enlighten Baked Global Illumination is deprecated

The Enlighten Baked Global Illumination lightmapping backend is no longer available by default. When you upgrade a project to this version, Unity removes the Enlighten baking backend from the lightmapper selection dropdown and substitutes a Progressive Lightmapper in every Scene where you’ve selected the Enlighten baking backend.

On Apple silicon devices, Unity substitutes the Progressive GPU Lightmapper for the Enlighten baking backend. On all other devices, Unity selects the CPU Progressive Lightmapper.

To continue using the Enlighten baking back end, open Edit > Project Settings > Editor and in the Graphics section of that menu, activate Enable Enlighten for Baked GI (Legacy). However, this option isn’t available in 2023.1 and later.

Minimum Bounces is not available in the Lighting window

The Minimum Bounces property of the Progressive Lightmapper is no longer available in the Lighting window.

When you upgrade a project to 2022.2, Unity resets the Minimum Bounces value to 2, the recommended number of minimum bounces for lightmapping. To change this value, edit the LightingSettings API property minBounces.

Unity’s default Gradle templates have changed

In 2022.2, Unity updated the default versions of all tools used by Android. The new versions are as follows:

Tool 版本
SDK
Cmdline-tools component version 6.0
Build-tools component version 32.0.0
Platform-tools component 32.0.0
Platform (API level) 31 and 32 added by default
Tools component Removed
NDK r23b
JDK (OpenJDK) 11.0.14.1+1
Gradle 7.2
Android Gradle Plugin 7.1.2

The update to Gradle version 7.2 changed some build.gradle file configuration options. This required significant changes to Unity’s default gradle templates. Unity won’t attempt to upgrade custom Gradle templates to match the new format which means projects that contain custom template files might fail to build. To solve this, recreate any custom template files based on the new default template files.

For information about the build.gradle configuration option changes, refer to the Android Gradle Plugin release notes.

Navigation and Pathfinding is moving from the Unity core to the AI Navigation package

The package documentation is located here: https://docs.unity3d.com/Packages/com.unity.ai.navigation@latest

If you have projects that were created with the Navigation feature in previous versions of the Unity engine you can do one of the following:

  • Continue to use your projects as they are
  • Convert your projects to use the new package

In either case, the AI Navigation package is automatically installed and added to your project.

To start using the new package you need to convert your project as follows:

  1. Go to Window > AI > NavMesh Updater.
  2. In the NavMesh Updater window, select which kind of data to convert.
  3. Click Initialize Converters to detect and display the types of data you selected.
  4. Select the data to be converted.
  5. Click Convert Assets to complete the conversion.

As part of the conversion process, the NavMesh Updater makes the following changes:

  • Any NavMesh that was previously baked and embedded in the scene is now referenced from a NavMeshSurface component created on a new GameObject called Navigation.
  • Any object that was marked with Navigation Static will now have a NavMeshModifier component with the appropriate settings.

If the NavMeshes in different scenes are baked with different agent settings then you need to create new Agent types to match those settings. To create the Agent types do the following:

  1. Go to Window > AI > Navigation.
  2. Select Agents.
  3. Create new entries and specify the relevant settings.

When you have created the new entries you then need to do the following:

  • Assign the newly created agent types to their respective NavMeshSurfaces in the Navigation created for that scene,
  • Assign the agent types to the NavMeshAgents intended to use that NavMesh.

To find the settings that were used for each existing NavMesh, select the NavMesh .asset file in the Project window. The NavMesh settings will be displayed in the Inspector.

If your project uses the NavMeshSurface, NavMeshModifier, NavMeshModifierVolume or NavMeshLink components defined by scripts downloaded from Unity’s NavMeshComponents GitHub repository , then remove those scripts and any associated files before you add the AI Navigation package to your project. If you don’t remove these scripts, you might get conflicts and errors related to these components in the Console. The new components mirror the same behavior as the old components do in your project except when using the following components:

  • The NavMeshSurface component now includes an option to use only the objects that have a NavMeshModifier in the baking process.
  • You can now specify whether or not to apply the NavMeshModifier component to child objects in the hierarchy.
Upgrade to Unity 2022 LTS
Upgrade to Unity 2022.1