Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Official UI Toolkit migration guide

Discussion in 'UI Toolkit' started by benoitd_unity, Jul 9, 2021.

  1. benoitd_unity

    benoitd_unity

    Unity Technologies

    Joined:
    Jan 2, 2018
    Posts:
    314
    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
    1. Open your project as usual with the desired Unity version.

    2. Update the UI Toolkit package using the Package Manager.

    3. 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.

    4. 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.
    5. 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

    1. Open a project that is not using the UI Toolkit package or remove it from your project
    2. Open Preferences > General and change the setting from System Font to Inter

    3. 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
    1. Close and reopen the project.
    2. 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

    1. Create a new Panel Settings Asset.

    2. Set the default UITK text asset in the Inspector when selecting the new Panel Asset.

    3. 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

    1. Open the project you wish to update (2020.3 or 2021.1) in Safe Mode.

    2. Ignore all compilation errors.

    3. From the Editor toolbar, go to Window > Package Manager.

    4. 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:

    1. 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.
    2. 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.
     
    Last edited: Aug 16, 2021
  2. benoitwiener

    benoitwiener

    Joined:
    Apr 17, 2019
    Posts:
    3
    Hi @benoitd_unity,

    Do you have also a migration guide for project with UI (made with GUI and canvas system) as an overlay to convert into UIToolkit?

    thanks for your reply

    P.S: If needed I can post a new thread if it doesn't exist. In reality we have a project with a lot of GUI in overlay (it's an app) and we have performance issues because of the canvas system and we would like to use the UIbuilder to improve our performance and also the simplicity for our designers. But we would like to be sure we don't have to start over with the new UIToolkit system again.
     
    joseGuate97 likes this.
  3. uMathieu

    uMathieu

    Unity Technologies

    Joined:
    Jun 6, 2017
    Posts:
    372
    @benoitwiener We have one such guide in the works. We'll keep you updated once it's up!
     
    joseGuate97 and Midiphony-panda like this.
  4. benoitwiener

    benoitwiener

    Joined:
    Apr 17, 2019
    Posts:
    3
    Thanks for your answer.
    But do you mean, it is already possible and easy to convert from old UI system to the new UItoolkit system in our project ? (If yes from which version?)
    if it's the case it could save us months of work!!

    So could you elaborate your answer?
    Do you mean the feature to convert is already implemented and we can use it but you still have to do a guide for that? or do you mean the feature is not yet implemented but planned?

    Thanks for the details.

    P.S: we would like to know if you convert your old UI and have performance issues (because too many batches) it will be solved because with the migration to the new system.
     
  5. antoine-unity

    antoine-unity

    Unity Technologies

    Joined:
    Sep 10, 2015
    Posts:
    659
    Tanner555 likes this.
  6. oobartez

    oobartez

    Joined:
    Oct 12, 2016
    Posts:
    143
    @JuliaP_Unity, @benoitd_unity regarding this:

    I understand that this is something you are aware of, but it is happening all the time, after a few minutes (or less than a minute) of using Unity. As such it is not currently possible to migrate to preview-15.

    We saw that you have fixed A LOT of bugs in preview-15 which is great! But migrating would make it impossible for our team to work with our project (Edit: Please see the discussion below, deleting Library and reinstalling UI Builder seems to help).
     
    Last edited: Aug 10, 2021
  7. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    653

    I'm sorry you're facing issues but we had to publish this version in order to unblock a lot of our users, and we'll be working on fixing other issues right away, including this one. Can you try doing a "Reimport All" from the Project view to see if this improves? In our experience it has helped!
     
  8. oobartez

    oobartez

    Joined:
    Oct 12, 2016
    Posts:
    143
    Thank you for the reply! As you suggested, we deleted the Library folder and uninstalled and reinstalled UI Builder. It appears to have helped, I'll keep you posted.
     
    JuliaP_Unity likes this.
  9. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    653
    Thanks for letting me know, I'm updating the troubleshooting text to mention cleaning the Library (Reimport All does the same) can help :cool:
     
  10. pawelduda

    pawelduda

    Joined:
    Feb 1, 2019
    Posts:
    45
    @JuliaP_Unity To update on the issue @oobartez was describing on my behalf.

    After Reimport All etc. editor still misbehaves each time I press Ctrl + S. Most of the text on labels is gone:
    upload_2021-8-10_23-29-25.png

    Here is the warning that is printed to the console during this:
    Also, this one goes on constantly in console:
     
    Anthiese likes this.
  11. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    653
    Thanks for all the info @pawelduda , we're taking note here and this should help us find a fix! Let us know if you find anything else :)
     
  12. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    653
    For people following this thread, preview.16 has been published with fixes to some issues discussed here. The migration guide contents have been updated. Cheers! :cool:
     
  13. tenukii

    tenukii

    Joined:
    Mar 31, 2014
    Posts:
    12
    Now I'm stuck at this error - cleared library:

    IndexOutOfRangeException: Index was outside the bounds of the array.
    UnityEngine.UIElements.TextCoreHandle.GetLineHeight (System.Int32 characterIndex, UnityEngine.UIElements.MeshGenerationContextUtils+TextParams textParams, System.Single textScaling, System.Single pixelPerPoint) (at Library/PackageCache/com.unity.ui@1.0.0-preview.16/Core/Text/TextHandle.cs:175)
    UnityEngine.UIElements.TextInputBaseField`1+TextInputBase[TValueType].DrawWithTextSelectionAndCursor (UnityEngine.UIElements.MeshGenerationContext mgc, System.String newText, System.Single pixelsPerPoint) (at Library/PackageCache/com.unity.ui@1.0.0-preview.16/Core/Controls/TextInputFieldBase.cs:759)
    UnityEngine.UIElements.TextInputBaseField`1+TextInputBase[TValueType].OnGenerateVisualContent (UnityEngine.UIElements.MeshGenerationContext mgc) (at Library/PackageCache/com.unity.ui@1.0.0-preview.16/Core/Controls/TextInputFieldBase.cs:735)
    UnityEngine.UIElements.VisualElement.InvokeGenerateVisualContent (UnityEngine.UIElements.MeshGenerationContext mgc) (at Library/PackageCache/com.unity.ui@1.0.0-preview.16/Core/VisualElement.cs:1456)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr, Boolean&) (at /Users/bokken/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:189)
     
    Last edited: Aug 17, 2021
  14. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    653
    @tenukii I'm not sure what's happening there, but I believed you commented earlier about it not being clear whether you have to convert assets or not and the answer is that if you're not moving to 2021.2, you do not want to convert your assets indeed.

    This migration guide has 2 separate parts: 1 for moving between the Package versions since there was an important change from 14 to 15 (adding the assembly definition) and explaining potential problems you may face; the other is for moving between the Package and 2021.2.

    Hope this is clearer now!
     
  15. tenukii

    tenukii

    Joined:
    Mar 31, 2014
    Posts:
    12
    Thanks for clearing that up for me. :)
     
  16. tenukii

    tenukii

    Joined:
    Mar 31, 2014
    Posts:
    12
    Found a 'fix' although it means removing functionality, hopefully this is temporary:

    Turns out .Focus() doesn't work on TextFields anymore - or at least the pre .15 way of doing it. I did figure out I could get the 'unity-text-input' reference with Q<VisualElement> to set the color, etc, but Focus() on that or the TextField both throw this error.

    Hopefully I'm just doing it wrong and it isn't a bug in UIToolkit.
     
    Last edited: Aug 17, 2021
  17. influxus

    influxus

    Joined:
    Jan 17, 2017
    Posts:
    2
    Just wondering, if a future package might enable migrating past preview.14 without the assembly definition step?
     
  18. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    653
    Sadly no, from now on you'll always need the assembly definition asset in order to guarantee the correct compilation order.
     
  19. CSStudentsGoe

    CSStudentsGoe

    Joined:
    Feb 17, 2020
    Posts:
    7
    Hello,

    After migrating to preview.16, I've got these two errors:
    upload_2021-8-18_17-11-35.png

    I tried deleting the Library folder and reimporting, but they remain. Any ideas?
    Cheers
     
  20. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    653
    What version of Unity are you on?
     
  21. CSStudentsGoe

    CSStudentsGoe

    Joined:
    Feb 17, 2020
    Posts:
    7
    Right, sorry, I forgot to precise.
    I'm on Unity 2021.2.0b7. I also tried with a previous beta, 0b4.
    It works with 2021.1, but I can't use it as the package I'm developing uses quite some C#9.0 features.
    Thanks!
     
  22. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    653
    With Unity 2021.2 you shouldn't use the package, the Runtime features are already in Unity! So the package doesn't work with that version. We already made it that the package can't even be installed in 2021.2+, it's just not out yet.

    Sorry about the confusion!
     
  23. CSStudentsGoe

    CSStudentsGoe

    Joined:
    Feb 17, 2020
    Posts:
    7
    I see! To be honest I never tried to install the package manually until now, but I wanted to try since preview.16 apparently fixed an issue regarding missing font asset warnings. I'll revert back to how it was.

    So, is the UI toolkit that is bundled with Unity 2021.2 updated in the same way as the package? / Am I getting these updates?

    Thanks!
     
  24. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    653
    The version of UI Toolkit in 2021.2 is more complete than what's in the package (there are features only available in 2021.2, for example). To make the package, we bring some of the fixes from 2021.2 to it, but no new features (some of the fixes, that would require big refactors, are not copied to the package). You're definitely getting more updates/fixes by using Unity 2021.2+ than by using the package :)
     
  25. skowroshima

    skowroshima

    Joined:
    Oct 14, 2018
    Posts:
    75
    This has been a nightmare to upgrade 2020.3 from preview 14 to 16.

    After adding the assembly reference and adding UIElementsModual, I have 100's of "The type or namespace" errors. Some of them have assembly references that I can add "Unity.Mathematics", "Cinemachine", etc. I'm randomly adding a dozen+ of them to the list, this seems somewhat absurd. You can't expect that everyone who uses UIToolkit is going to create this assembly reference file?

    What do I add for these?
    does not exist in the namespace 'UnityEngine.VFX'
    does not exist in the namespace 'TMPro'

    Then I have asset store purchases that have namespaces... What do I need to do for each of these? There is no "Digger" reference, do i need to create something for all my purchased assets too?

    Assets\Digger\Sources\Digger\Editor\Upgrading.cs(4,14): error CS0234: The type or namespace name 'Unsafe' does not exist in the namespace 'Digger' (are you missing an assembly reference?)
    Assets\Plugins\Easy performant outline\Scripts\PipelineAssetUtility.cs(106,23): error CS0246: The type or namespace name 'ForwardRendererData' could not be found (are you missing a using directive or an assembly reference?)
     
    tenukii likes this.
  26. CSStudentsGoe

    CSStudentsGoe

    Joined:
    Feb 17, 2020
    Posts:
    7
    Okay great! Thanks a lot for the clarification :)
     
  27. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    653
    Hey there, indeed if you have other assemblies you're using, you'll need to add references to them in the Assembly Definition asset. It should be straightforward though and I'm not sure why it's being so painful for you :(

    If you remove the Assembly Definition asset and everything compiles, you can watch those classes to see from which assemblies they come and then add them back to the Assembly Definition afterwards. Have you given that a try?
     
  28. skowroshima

    skowroshima

    Joined:
    Oct 14, 2018
    Posts:
    75
    I removed the Assembly Definition asset to get it to compile. I was then able to use the object explorer to find the assemblies for the unity namespaces I'm using. I'm still stuck unable to reference some of the asset store included references.

    For instance:
    Assets\Digger\Sources\Tests\Editor\VoxelTests.cs(3,7): error CS0246: The type or namespace name 'NUnit' could not be found

    Object explorer says NUnit is a member of nunit.framework, but I don't see that as an option to add as an assembly reference. (dll exists in Library\PackageCache\com.unity.ext.nunit@1.0.6\net35\unity-custom\nunit.framework.dll)

    Another even more confusing one is:
    Assets\Digger\Sources\Digger\Editor\Upgrading2.cs(4,14): error CS0234: The type or namespace name 'Unsafe' does not exist in the namespace 'Digger'

    Where Digger is a member of the Assembly-CSharp-Editor project (the main unity game c# project). It's code that was added via package to the assets directory. Is there a way I can reference it? Or?
     
  29. influxus

    influxus

    Joined:
    Jan 17, 2017
    Posts:
    2
    In my case for a number of my assets I had to add an assembly definition file inside each "Editor" folder that only compiles that folder for the editor - see this thread:

    https://forum.unity.com/threads/assembly-definition-woes.509541/

    As the scripts inside the Editor folder generally depended on scripts from elsewhere in that asset, I would then need to create a regular assembly definition at the root of that asset. I then needed to add the asset assembly file to the assembly definition reference section in the asset editor assembly and to the main assembly file.
     
  30. vertxxyz

    vertxxyz

    Joined:
    Oct 29, 2014
    Posts:
    88
    Is this becoming standard? I personally use assembly definitions in every one of my projects, but it seems odd to force them onto users, it's a lot to communicate to beginners (I understand this is a preview package, just speaking generally.)

    If not, I'd be interested to hear why they've become a requirement for this package.
    I'm hearing compilation order - I imagine there's something weird going on specifically with UIT's requirements.
     
  31. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    653
    Because UI Toolkit exists within Unity already, the UI Toolkit package has to do extra work to override that one completely. That's why the assembly definition is required in this case. It's not the rule now, it's the exception for sure ;)
     
    vertxxyz likes this.
  32. benoitwiener

    benoitwiener

    Joined:
    Apr 17, 2019
    Posts:
    3
    Thanks @antoine-unity, @uMathieu

    We have tried to use the package Copycatz, but we didn't manage to make it work unfortunately.

    We are ready to convert our old canvas with the GUIsystem made with Unity 2019 version, into the new UIBuilder.

    You said we can do it "manually" : does it mean we have to start all over again the UI of our app with UIbuilder?, or is there any way we could convert our UI made on the GUI System from the Unity version 2019 into the UiBuilder version 2020.2.4f ?
    Is your Manual going to help in this matter?
     
    joseGuate97 likes this.
  33. sershe

    sershe

    Joined:
    Sep 9, 2016
    Posts:
    15
    Hmm, following this guide on Unity 2020.3.1f, after creating an assembly definition precisely as per the above I can no longer compile because UI Toolkit is no longer available during compilation (e.g. UIDocument is no longer present, so I get a compile error).
    This happens with or without the upgrade (I am on preview-14).
    Simply deleting the assembly definition again fixes the issue.
     
  34. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    653
    I'm not sure why you're on preview.14, but these steps are from going to preview.15+. However as far as I know there shouldn't be an issue with using an Assembly Definition with previous versions, there's probably just a problem with the configuration for you.
     
  35. MarcelArioli

    MarcelArioli

    Joined:
    May 31, 2014
    Posts:
    27
    Hey there!

    I'm using 2021.1.22f and ui toolkit 17, and I'm having this critical error when subscenes get imported :

    Error: Could not load signature of UnityEngine.UIElements.InputSystem.InputSystemEventSystem:get_focusedPanel due to: Could not resolve type with token 01000024 (from typeref, class/assembly UnityEngine.UIElements.RuntimePanel, UnityEngine.UIElementsModule, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null) assembly:UnityEngine.UIElementsModule, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null type:UnityEngine.UIElements.RuntimePanel member:(null) signature:<none>
    Crash!!!

    I currently don't even have any UIDocument in the scene or anything, just imported the package and setup the assembly definition (I don't have any compile errors).

    deleting library folder didn't help, reimport all didn't help. Any suggestions ? :) thanks !
     
  36. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    653
    Hello, you mentioned subscenes - are you using DOTS?

    Also you said you don't have an UIDocument in the scene (or subscene), but do you have other stuff? Do you have a component of type
    InputSystemEventSystem
    in there?

    The error you're mentioning is not ringing any bells here, so we'll need more info to get to the root - if you have a simple project in which the error happens and that you could share with us that would also help :)
     
  37. MarcelArioli

    MarcelArioli

    Joined:
    May 31, 2014
    Posts:
    27
    Thanks for reaching out, yes i'm using DOTS.

    I just reproduced the issue within 10 minutes or so, in a new project, here's the steps :

    1. Create new project with 2021.1.22f1 (3D hdrp sample)
    2. Close unity
    3. Swap out package manifest (see manifest below)
    4. open project again
    5. setup assembly def just in Assets, I called it RootAssembly (add UnityEditor.UIElementsModule + Unity.InputSystem, remove auto referenced and toggle by guid, like in this guide explained)
    6. Rightclick in hierarchy > create new subscene (it will be open by default)
    7. close subscene (this will trigger the reimport, at this point an error in the console should appear)
    8. look at Logs folder (AssetImportWorker0.log), scroll down a bit and you'll find the error message i posted previously


    The manifest I use (you can copy paste as is):

    {
    "dependencies": {
    "com.unity.2d.sprite": "1.0.0",
    "com.unity.addressables": "1.18.9",
    "com.unity.cinemachine": "2.7.8",
    "com.unity.collab-proxy": "1.9.0",
    "com.unity.dots.editor": "0.12.0-preview.6",
    "com.unity.ide.rider": "3.0.7",
    "com.unity.ide.visualstudio": "2.0.11",
    "com.unity.ide.vscode": "1.2.4",
    "com.unity.inputsystem": "1.0.2",
    "com.unity.platforms.windows": "0.10.0-preview.10",
    "com.unity.polybrush": "1.1.2",
    "com.unity.render-pipelines.high-definition": "11.0.0",
    "com.unity.rendering.hybrid": "0.11.0-preview.44",
    "com.unity.test-framework": "1.1.29",
    "com.unity.textmeshpro": "3.0.6",
    "com.unity.timeline": "1.5.6",
    "com.unity.ui": "1.0.0-preview.17",
    "com.unity.visualscripting": "1.6.1",
    "com.unity.modules.ai": "1.0.0",
    "com.unity.modules.androidjni": "1.0.0",
    "com.unity.modules.animation": "1.0.0",
    "com.unity.modules.assetbundle": "1.0.0",
    "com.unity.modules.audio": "1.0.0",
    "com.unity.modules.cloth": "1.0.0",
    "com.unity.modules.director": "1.0.0",
    "com.unity.modules.imageconversion": "1.0.0",
    "com.unity.modules.imgui": "1.0.0",
    "com.unity.modules.jsonserialize": "1.0.0",
    "com.unity.modules.particlesystem": "1.0.0",
    "com.unity.modules.physics": "1.0.0",
    "com.unity.modules.physics2d": "1.0.0",
    "com.unity.modules.screencapture": "1.0.0",
    "com.unity.modules.terrain": "1.0.0",
    "com.unity.modules.terrainphysics": "1.0.0",
    "com.unity.modules.tilemap": "1.0.0",
    "com.unity.modules.ui": "1.0.0",
    "com.unity.modules.uielements": "1.0.0",
    "com.unity.modules.umbra": "1.0.0",
    "com.unity.modules.unityanalytics": "1.0.0",
    "com.unity.modules.unitywebrequest": "1.0.0",
    "com.unity.modules.unitywebrequestassetbundle": "1.0.0",
    "com.unity.modules.unitywebrequestaudio": "1.0.0",
    "com.unity.modules.unitywebrequesttexture": "1.0.0",
    "com.unity.modules.unitywebrequestwww": "1.0.0",
    "com.unity.modules.vehicles": "1.0.0",
    "com.unity.modules.video": "1.0.0",
    "com.unity.modules.vr": "1.0.0",
    "com.unity.modules.wind": "1.0.0",
    "com.unity.modules.xr": "1.0.0"
    }
    }

    Thanks for investigating! It is quite a crucial bug because no subscene works anymore :)
     
    Last edited: Sep 30, 2021
  38. WAYN_Games

    WAYN_Games

    Joined:
    Mar 16, 2019
    Posts:
    869
    Hello @JuliaP_Unity ,

    I run in the same issue.
    Is has been a lingering issue when using Entities in combination with both UITK and New Input system packages.

    here is what I have as trace i nhte assertImportLog :

    Code (CSharp):
    1. Symbol file LoadedFromMemory is not a mono symbol file
    2. Error: Could not load signature of Unity.UI.Builder.BuilderTextShadow:.ctor due to: Could not resolve type with token 010000e6 (from typeref, class/assembly UnityEngine.UIElements.StyleTextShadow, UnityEngine.UIElementsModule, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null) assembly:UnityEngine.UIElementsModule, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null type:UnityEngine.UIElements.StyleTextShadow member:(null) signature:<none>
    3. Error: Could not load signature of UnityEngine.UIElements.InputSystem.InputSystemEventSystem:get_focusedPanel due to: Could not resolve type with token 01000022 (from typeref, class/assembly UnityEngine.UIElements.RuntimePanel, UnityEngine.UIElementsModule, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null) assembly:UnityEngine.UIElementsModule, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null type:UnityEngine.UIElements.RuntimePanel member:(null) signature:<none>
    4. ..\mono\metadata\custom-attrs.c:1273: Could not load type UnityEngine.UIElements.UIDocument, UnityEngine.UIElementsModule, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null while decoding custom attribute: (null) assembly:<unknown assembly> type:UnityEngine.UIElements.UIDocument, UnityEngine.UIElementsModule, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null member:(null) signature:<none>
    5.  
    6. Crash!!!
    As far as I can tell it has to do with a change the way unity build and signs it's package manifest. this issue was not present in 2021 last time I check but since it's recommended for DOTS to remain on 2020, we face the issue...
    I think there was a similar issue wit hthe UITK package alone in int's previous version (15 and lower) but it was resolved.
    Now entiteis and UITK (alone) work together with subscene. Entites and new input (alone) work togetehr wit hsubscene
    but Entites+UITK+New Input don't work together in subscene (even when the subscene is empty...) but without subscene there is no conflict/issue.
     
  39. WAYN_Games

    WAYN_Games

    Joined:
    Mar 16, 2019
    Posts:
    869
    @JuliaP_Unity,
    I tryied pushing investigation a bit on this one but with no luck (I'm well out my depth :p ).
    My understanding is that when using DOTS subscene, the asset importer run a headless unity instance to convert the subscene to entities and cache the serialized version of the sub scene.
    This headless version crashes and restart undefinitly leading to a pile up of assetImportWorker log in error.
    You'll find attached on of the crash log.
     

    Attached Files:

    chriseborn and JuliaP_Unity like this.
  40. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    653
    Thanks for the extra info, we have someone on our side looking into it :cool:
     
    MarcelArioli and WAYN_Games like this.
  41. mcoted3d

    mcoted3d

    Unity Technologies

    Joined:
    Feb 3, 2016
    Posts:
    885
    @WAYN_Games I investigated this issue, but it is very hard to pinpoint where the problem is. It could be a scripting issue, a DOTS issue, or assembly override issue, or something else.

    I would encourage you to open a bug report with these steps and extra info so that the QA team can properly assess and assign this issue to the right team. They are sometimes able to provide workarounds as well.
     
    JuliaP_Unity likes this.
  42. jnhackleman_unity

    jnhackleman_unity

    Joined:
    Sep 16, 2021
    Posts:
    20
    I just tried to follow this guide going from 2021.1.2 to 2021.2.0f1 and failed.
    I force opened the project in safe mode (this would be a handy option to add to unity hub BTW)
    I removed the UI Toolkit from package manager, and no "Asset Converter" popped up.
    I checked the menu location specified, and there was no asset converter listed.

    I thought I read it wrong, and maybe I should have opened my project in 2021.2 FIRST and undergone the rest of the tutorial, but that fell apart to.

    For now I am just opening the project in the new version I want and manually implemented the broken and or needed UI document / object UITK objects.

    I AM however flooded with errors now that I have mentioned here:
    https://forum.unity.com/threads/une...spamming-console-after-unity-upgrade.1192108/
     
  43. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    653
    Hello, I haven't personally tried to use Burst on my projects but I see no reason why this would have interfered with the asset conversion.

    I suggest following up on that thread for your Burst errors, and we can try to troubleshoot your asset conversion issues here, separately.

    You said you don't see the menu item to do the conversion yourself (Window > UI Toolkit > Package Asset Converter), is this still the case if you close and reopen Unity?
     
  44. TobiasMTM

    TobiasMTM

    Joined:
    Mar 26, 2021
    Posts:
    5
    Edit: This guide is not for the old unity version. Upgraded the whole project to Unity 2021. Seems to work again ;)

    Hi,

    not sure if I missed something essential here. I added the assembly as described after the "UI Document not found" error occurred today.

    Facts:
    • Unity 2020.3.16f1
    • UI Builder 1.0.0-preview.18
    • UI Toolkit 1.0.0-preview.17

    My Warnings / Errors
    Code (CSharp):
    1. Assembly for Assembly Definition File 'Assets/UI Toolkit/UIAssembly.asmdef' will not be compiled, because it has no scripts associated with it.
    2. UnityEditor.Scripting.ScriptCompilation.EditorCompilationInterface:CompileScriptsNoStop (UnityEditor.Scripting.ScriptCompilation.EditorScriptCompilationOptions,UnityEditor.BuildTargetGroup,UnityEditor.BuildTarget,string[])
    3.  
    4. Assets\Scripts\UIController.cs(11,12): error CS0246: The type or namespace name 'UIDocument' could not be found (are you missing a using directive or an assembly reference?)
     
    Last edited: Mar 2, 2022
  45. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    653
    Hey, not sure what you mean by this guide not being for the old Unity version, as the first part applies to Unity 2020.3 with the packages installed. Please note that you should be using version 1.0.0-preview.18 of both the UI Toolkit and the UI Builder packages.

    However, moving on to 2021.2 requires not package installation, and yes the second part of the migration guide applies to that case and if I understand correctly you're all set up now so glad this is solved! If this is not the case, please let us know what the issues are. :cool:
     
  46. DevViktoria

    DevViktoria

    Joined:
    Apr 6, 2021
    Posts:
    94
    With 2020.3.25f1 everything was fine. I just upgraded from Unity 2020.3.25f1 to 2020.3.30f1. And now I got the following errors:
    Code (CSharp):
    1. error CS0234: The type or namespace name 'UIDocument' does not exist in the namespace 'UnityEngine.UIElements' (are you missing an assembly reference?)
    2. Shader error in 'Hidden/TextCore/Editor/Distance Field SSD': Couldn't open include file 'TextCore_Properties.cginc'. at line 60
    What steps I should follow in this scenario?
     
  47. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    653
    Just checking before anything else that you have the Assembly Definition (steps 3-4-5 of the migration guide)?
     
    DevViktoria likes this.
  48. DevViktoria

    DevViktoria

    Joined:
    Apr 6, 2021
    Posts:
    94
    Eventually I created an assembly definition and that solved the issue. I just totally surprised that I have to do that even if I upgrade from Unity 2020.3.25f1 to 2020.3.30f1. Especially since I am using the new Input System and DOTS now the assembly definition looks like this:
    upload_2022-3-22_12-35-25.png
     
  49. PeppeJ2

    PeppeJ2

    Joined:
    May 13, 2014
    Posts:
    33
    I also ran in to partially the same issue as DevViktora posted. While I do not have any compile errors I get a shader error
    Shader error in 'Hidden/TextCore/Editor/Distance Field SSD': Couldn't open include file 'TextCore_Properties.cginc'. at line 60


    I do have Asmdefs for my project (not auto references, manually referencing UnityEngine.UIElementsModule). If I try manually reimporting the offending file
    UI Toolkit/Shaders/TextCore-SDF-SSD
    it keeps throwing the same error.

    Since it's a shader related issue I should point out that I am using URP. It's worth noting that the error doesn't persist. Clearing the console gets rid of it, but like mentioned a reimport of said file causes it to appear again.

    Unity 2020.3.30f1, here are my packages:
    upload_2022-4-17_1-57-26.png
     
    Last edited: Apr 17, 2022
  50. joseGuate97

    joseGuate97

    Joined:
    Mar 1, 2018
    Posts:
    42
    Was that guide ever published @uMathieu? The only official reference covering this that I've found is this https://docs.unity3d.com/Manual/UIE-Transitioning-From-UGUI.html.

    As @benoitwiener pointed out, for UI-heavy applications it is not trivial how to minimize the amount of UI that must be re-done from scratch.

    I asked about this issue here too https://forum.unity.com/threads/ugui-or-ui-toolkit.936155/#post-8556056
     
unityunity