Version: 2021.1
API updater
Upgrading to Unity 2020.1

Upgrading to Unity 2020.2

Note: Follow the advice in this section in release order. For example, if you need to upgrade your project from 2018 to 2020, read the 2019 upgrade guides to see if there are any changes that you need to make before you read the 2020 upgrade guides.

This page lists changes in the Unity 2020.2 version which might affect existing projects when you upgrade from version 2020.1 to 2020.2.

Adaptive Performance breaking changes

To update Adaptive Performance from 1.0 to 2.0, see the Adaptive Performance upgrade guide.

Xcode Project Generation

The MacOS Standalone Xcode project building path selection has changed. Now you must provide the path to the desired directory, and the .xcodeproj and accompanying files are created inside the target directory. The MacOS build folder can not be inside the project directory. See the manual page for Xcode project structure.

AR/VR Platforms Support

This document provides a guide for upgrading existing AR/VR projects that are using Unity versions prior to Unity 2020 releases.

Enable AR/VR in Project Settings

When upgrading your existing project to Unity 2020 releases and later, you should receive a notification that states the deprecated XR integration (previously in Player/XR Settings) has been disabled.

During Asset import, before the Unity Editor is launched.
During Asset import, before the Unity Editor is launched.

To enable AR/VR, use XR Plug-in Management in Project Settings and select your target platforms.

Note: We recommend fixing any upgrade-related script errors before installing XR Plug-in Management.
Note: We recommend fixing any upgrade-related script errors before installing XR Plug-in Management.

Virtual reality

Platform Build target Plug-in provider
Oculus Quest Android Oculus
Oculus Rift & Rift S Desktop Oculus
Windows Mixed Reality VR UWP Windows Mixed Reality

Augmented reality

Platform Build target Plug-in provider
ARCore devices Android ARCore
ARKit devices iOS ARKit
HoloLens UWP Windows Mixed Reality
Magic Leap One Lumin Magic Leap

Use optimal Player settings

Make sure your project’s rendering and quality settings are optimal. The tables below detail recommended settings by target platform.

Virtual reality

Platform Graphics API Stereo rendering mode
Oculus Quest OpenGL ES 3.0 Multiview
Oculus Rift & Rift S DX11 Single Pass Instanced
Windows Mixed Reality VR DX11 Single Pass Instanced

Augmented reality

Platform Graphics API Stereo rendering mode
ARCore devices OpenGL ES 3.0 N/A
ARKit devices Metal N/A
HoloLens DX11 Single Pass Instanced
Magic Leap One OpenGL ES 3.2 Single Pass Instanced

Note: “Single Pass” is no longer a rendering mode option, as “Single Pass Instanced” is more performant. If you are upgrading from “single pass” to “single pass instanced”, you may have to update custom shaders in your project.

Render Pipeline

The built-in render pipeline, Universal Render Pipeline, and High-Definition Render Pipeline are all supported in 2020.1. There are benefits to using our latest scriptable render pipelines, but it is not a requirement in this upgrade process.

Note: If you are using 3rd-party assets and/or custom shaders, you may need to update assets with shaders compatible with “single passed instanced”.

Camera in Scene

If you are using the XR Interaction Toolkit, no change is required for camera tracking.

If you are using a 3rd-party toolkit for camera tracking (OVRCameraRig, etc), make sure you have updated to the latest version. Note that upgrading to latest versions of 3rd-party tools might cause script errors, please reference 3rd-party documentation.

If you are using a Tracked Pose Driver for camera tracking, see our Migration Guide.

Upgrading 3rd-Party Toolkits

If you are using any toolkits developed by our supported platforms (Oculus Integration package, MRTK, MLTK), make sure you’re using the latest version. Note that upgrading to the latest versions of 3rd-party tools might cause upgrade-related script errors, and you may need to reference corresponding documentation of those toolkits.

FAQ

Why can’t I install XR Plug-in Management in Project Settings?

You may have upgrade-related script errors that need to be fixed before installing XR Plug-in Management.

Why are OpenVR and Google Cardboard missing from XR Plug-in Management?

The OpenVR and Google Cardboard XR Plug-ins are developed and maintained by Valve and Google, respectively. Links to installation instructions for both platforms can be found in our documentation.

Is the Unity input system supported?

Yes, our supported platform integrations are compatible with the Unity input system.

Are the Universal Render Pipeline and High-Definition Render Pipeline supported?

Yes, our supported platform integrations are compatible with both the Universal Render Pipeline and High-Definition Render Pipeline.

Why can’t I view the XR Interaction Toolkit in Package Manager?

The XR Interaction Toolkit is still in preview. To view preview packages in 2020.1, you must enable it using the Package Manager tab in Project Settings. Once enabled, preview packages will be displayed in the Unity Registry of the Package Manager.

Why doesn’t Play in Editor work for my provider?

Play in editor support only works for providers that have standalone support for their provider. If the provider is not listed in the standalone section of the XR Plug-in Management provider selection UI then Play in Editor will not work. Check your provider documentation as they may support some other means of integrating Play in Editor support.

Why can’t I use “single pass” rendering mode?

“Single pass” is no longer supported in 2020.1 as “single pass instanced” is most performant. If your project used “single pass” rendering, you may have to update shaders in your project. Third-party libraries that use custom shaders for “single pass” may also need to be updated. You can choose to upgrade from “single pass” to “multipass” and shaders should work, but we recommend targeting “single pass instanced” for maximum performance.

How do I configure graphics API?

Graphics API is configured in Player settings (“Edit” → “Project Settings” → “Player”).

How do I configure stereo rendering mode?

Rendering mode is configured in provider-specific settings nested under XR Plug-in Management in Project Settings.

Why am I getting errors with renderScale using the XR Settings API?

renderScale has been removed and replaced with eyeTextureResolutionScale but that has been a script updater task since 2019.3. If you are upgrading from a Unity version prior to 2019.3, you will have to manually replace renderScale with eyeTextureResolutionScale.

Why isn’t input from my controllers (e.g. button presses) recognized by the XR Interaction Toolkit?

The headset needs to be detected before any device inputs can be detected. One common issue when testing, is that many people let their headsets rest on a table while debugging their interactions. The controllers won’t get recognized until you wear the headset (or the proximity sensor inside the headset gets activated). If you don’t get any input from your device, put on your headset after starting the app, or cover the proximity sensor.

Can I use the wide-angle camera on iPhones in AR Foundation apps?

ARKit does not provide the option of changing FOV of the camera.

API updater
Upgrading to Unity 2020.1
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961