Updated migration guide!
With the preview.15 and preview.16 updates, here come the new details you’ll need to know to both move between package versions and from package to 2021.2
NOTE: You need both UI Toolkit and UI Builder packages to be on version preview.15 or preview.16 if you want to use both, as they’re not compatible with other versions. We highly recommend using preview.16 due to important fixes.
Package version migration guide
This guide provides step-by-step instructions for those looking to upgrade all projects using the UI Toolkit Package (com.unity.ui) for runtime assets from preview.14, preview.15, or preview.16. The steps should be valid for editor versions 2020.3.xxx and 2021.1.xxx. Due to some issues with IL2CPP, in order to make builds it is required to use the most recent version of the Unity Editor.
NOTE: version preview.15 had serious issues and was quickly replaced by preview.16, we highly recommend going to preview.16 straight away.
Migration process
Project Setup
-
Open your project as usual with the desired Unity version.
-
Update the UI Toolkit package using the Package Manager.
-
If you don’t yet have one, create an Assembly Definition on your project either through the Assets menu or through right-clicking on your Project window and selecting Create > Assembly Definition. If you have an Assembly Definition already, follow the next step to make sure the references are set correctly anyway.
-
Remove the “Auto Referenced” option on the Assembly Definition. Under “Assembly Definition References”, unselect “Use GUIDs” and add a reference to the “UnityEngine.UIElementsModule”. By doing these changes, we guarantee the order of compilation will be the expected one (your project will compile after the UI Toolkit package). Don’t forget to click “Apply” in the inspector for the Assembly Definition.
-
If you have other assemblies you reference (e.g. Addressables, Cinemachine, Timeline), you’ll have to add those Assembly Definition References as well.
Known issues
This section addresses known issues with migrating UI Toolkit from package version 14 to 15. We’re working on fixing them for future updates.
Editor text is missing when using System Font preference (preview.15)
NOTE: update to preview.16 to avoid having this issue
-
Open a project that is not using the UI Toolkit package or remove it from your project
-
Open Preferences > General and change the setting from System Font to Inter
-
You can now add your project containing the UI Toolkit package or re-add it to the current project.
Editor text is missing or broken after saving a scene or building the player
NOTE: update to preview.16 to avoid having this issue
-
Close and reopen the project.
-
If the problem appears to happen without building the player, try cleaning the Library folder by either deleting it with Unity not running, or selecting “Reimport All” from the Project view inside Unity.
Text stop showing up in Runtime
-
Set the default UITK text asset in the Inspector when selecting the new Panel Asset.
-
Reference the new Panel Asset for Panel Settings in the UIDocument.
Runtime asset migration guide
This guide provides step-by-step instructions for those looking to upgrade all projects using the UI Toolkit Package (com.unity.ui) for runtime assets to 2021.2. Several issues will be addressed in a future beta build of the Editor, which will simplify the update process.
Prerequisites
This migration guide is designed to migrate the following versions of Unity to 2021.2:
- 2020.3
- 2021.1
Package compatibility
The migration guide is compatible with the following package versions of com.unity.ui:
- com.unity.ui Version 1.0.0-preview.14
- com.unity.ui Version 1.0.0-preview.15
- com.unity.ui Version 1.0.0-preview.16
NOTE: version preview.15 had serious issues and was quickly replaced by preview.16, we highly recommend going to preview.16 straight away.
Migration process
Project Startup - for preview.14, preview.15 and preview.16 versions
-
Open the project you wish to update (2020.3 or 2021.1) in Safe Mode.
-
Ignore all compilation errors.
-
From the Editor toolbar, go to Window > Package Manager.
-
Choose the UI Toolkit package (com.unity.ui), then select Remove.
UI Toolkit Package Asset Converter
After removal of UI Toolkit, the UI Toolkit Package Asset Converter dialog box appears. You can also access it from the Editor toolbar, under Window > UI Toolkit > Package Asset Converter.
Verify the selected assets are correct, then select Convert to start the conversion process.
Attach the default style sheet - for preview.14 version only
Panel Settings styles now use a new Theme asset format. You must manually create and assign one to the existing PanelSettings. To create a new default style sheet:
- In the project window, right-click and select Create > UI Toolkit > Panel Settings Asset to create a new PanelSettings. This imports the default theme style sheet into your project. You can delete the PanelSettings asset you just created.
- Under Panel Settings, change the Theme Style Sheet parameter for each PanelSettings asset in your project to the UnityDefaultRuntimeTheme asset.
Known issues
This section addresses known issues with migrating UI Toolkit from packages to Core.
Default style sheets
Affected versions:
- 2020.3
- 2021.1
Default style sheets are not automatically created and assigned during the migration from Package Version preview.14 to 2021.2. This issue is fixed for com.unity.ui Versions 1.0.0-preview.15 and preview.16.
TextCore assets
Affected versions:
- 2021.2.0b1
In 2021.2.0b1, the package conversion tool does not convert TextCore assets. A new version of 2021.2 will come soon with a fix to this problem. You must recreate the following assets in your project:
- FontAsset
- SpriteAsset
- TextColorGradient
- TextStyleSheet
- PanelTextSettings
Support for migrating TextCore assets will be added to UI Toolkit Package Asset Converter in the near future.