Upgrading to 2021.2.0b1

Hello

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:
7271113--878038--upload_2021-6-25_15-31-53.png

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.

Hi @Maverick !

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

I hope that helps!

Thanks that helped (I was missguided by unity documentation). :slight_smile:

Another question related to upgrade process:

In previous version, near UIDocument I had attached InputSystemEventSystem component.
7271524--878167--upload_2021-6-25_17-52-10.png

After upgrade it switched to missing script. I just removed the reference to that component, but now some mouse events do not get through.

Anything new in that regard?

Thanks.

PS: All my SDF fonts where broken after update, had to recreate them.

Hi,

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

Thanks for info. But, is it required? I do receive events regardless of having or not [EventSystem + InputSystemUIInputModule] in the scene.

In, my case the problem is in WheelEvent, now mouseDelta is always 0,0 and modifiers are always none.

7278067--879520--upload_2021-6-28_13-20-46.png

Is it intended, was there a change in default behavior?

@HugoBD-Unity , @uBenoitA any comment about above issue, should I file a bug?

Thanks

Hi Maverick,

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.