Trying to upgrade my current project from 2021.1.5 to 2021.2.0b1, with no success. I’m getting a bunch of errors related to TextHandle.cs
For example
Library\PackageCache\com.unity.ui@1.0.0-preview.14\Core\Text\TextHandle.cs(193,24): error CS0246: The type or namespace name 'TextOverflowMode' could not be found (are you missing a using directive or an assembly reference?)
Library\PackageCache\com.unity.ui@1.0.0-preview.14\Core\Text\TextHandle.cs(58,27): error CS0234: The type or namespace name 'TextInfo' does not exist in the namespace 'UnityEngine.TextCore' (are you missing an assembly reference?)
These are installed packages:
I’ve also tried without UI Builder package, reimporting from scratch, removing adding packages, all didn’t help. Please note, I need runtime support.
What do I miss/doing wrong?
Thanks.
PS: Tried to find a solution on forums, but could get any useful info.
You no longer need the com.unity.ui package nor the com.unity.textcore package in 2021.2. All runtime features and more are part of Unity core. Simply removing them should fix the errors.
Be aware that assets created with the package will need to be upgraded to work without it. There is a tool that does it automatically in Window/UI Toolkit/Package Asset Converter
If you’ve removed the com.unity.ui package from your project, you will now need to replace the old InputSystemEventSystem by the equivalent [EventSystem + InputSystemUIInputModule] components in your scene. UI Toolkit now relies on the same EventSystem components that are used when using new Input with UGUI (Unity’s component-based UI system with Canvas etc.)
You might be receiving some events from the invisible DefaultEventSystem that kicks in when nothing else is there, but those events are not going to be sufficient to have full functionality. There’s not really another way around it, if you want to have UI Toolkit runtime with the new Input System package activated, in Unity 2021.2 and going forward, you need to use the EventSystem + InputSystemUIInputModule components.
It’s the intended way to set it up, and yes there was a change in the default behavior between the UI Toolkit preview 14 package and the Unity 2021.2 built-in UI Toolkit. If anything, the bug would be that you receive any events at all in your current setup, instead of getting a warning or an error, but it’s something we are aware of, so no need for a bug report I don’t think.
I hope this works for you, sorry for the inconvenience in your upgrading process.