UI

What happend to unity UI in 2019.14. Did you completely remove unity.UI in version 14?

1 Like

What are you talking about? Everything is working.

I am talking about unity.UI in 2019.2.014a

Do you mean UnityEngine.UI? Do you have compilation errors?

It seemed like they completely removed it

Ugui is now a package. You should be able to find it in the package manager.

5 Likes

I am on 2.0b1 - It disappeared for me too. Added the package, still no UnityEngine.UI namespace. Quick actions recommends UnityEngine.UIElements, but that’s not the same Buttons have no onClick and InputField isn’t there.

EDIT (Solved): Had to add the Unity.ugui to my ASMDEF file too.

1 Like

I’m Unity asset developer.
When the basic functionality is packaged, I just need to create an asset package for each Unity version just to add the dependency package to asmdef.
I want to configure asmdef per Unity version.

For example:

{
    "name" : "MyAsset",
    "references" : [
        "MyAssetCore"
    ],
    "unity_2019_2_or_newer" : {
        "references": [ // Proposal 1 : Overwrite
            "MyAssetCore",
            "Unity.ugui"
        ]
        "add_references" : [ // Proposal 2 : Add to default settings
            "Unity.ugui"
        ]
    }
}
3 Likes

Hey @karl_jones , there should definitely be more documentation about this change and the manual work required.
I needed to add Unity.ugui as asmdef reference manually to all DLLs in my project that are referencing UnityEngine.UI.

(which, by the way, is harder than it should be because it seems assembly definition references can’t be drag-dropped from a package (Unity UI) to a project DLL)

Isn’t that something that you could at least try to auto-assign on import?

We have a plugin that references the UnityEngine.UI unity extension.

Is there any way to have a plugin reference a package? :slight_smile:

We will be adding more documentation. Sadly there is no easy way to auto-fix this. We dont know if an asmdef is using UnityEngine.UI.

The plugin should be able to reference it if the asmdef is auto referenced. https://docs.unity3d.com/Manual/ScriptCompilationAssemblyDefinitionFiles.html

I updated the editor to version 2019.2.0b1( last 2019.2a14):

Assets\Scripts\UI\DialogController.cs(5,19): error CS0234: The type or namespace name 'UI' does not exist in the namespace 'UnityEngine' (are you missing an assembly reference?)

I can not find Ugui in the list of packages.

4526599--419161--hub.PNG

There is no such item in the list.

The package is not listed, but it is installed. I added it to the assembly definition and errors disappeared. But Unity UI did not appear on the list.

I’m having issues with using Unity Purchashing (IAP), stores.dll cannot find UnityEngine.UI because of the new package manager changes.

Could not load signature of UnityEngine.Purchasing.UIFakeStore:GetOkayButton due to: Could not load file or assembly 'UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. assembly:UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null type:<unknown type> member:(null) signature:<none>

Any way to fix this issue?

5 Likes

I guess you have to get the scripts to compile again before Package Manager updates itself. When upgrading to Unity 2019.1 I had this issue with VFX graph relying on Timeline which became a package and also for UNet stuff.

This change breaks every single DLL that has a dependency on UnityEngine.UI.dll. This means a lot of assets, including Rewired, now have to release a new branch for 2019.2 separate from 2019.1 to get around this. Leaving the dll name UnityEngine.UI.dll instead of changing it to Unity.ugui.dll would avoid this major breaking change.

4 Likes

Currently, built-in packaging affects many assets.
Could you add a parameter like "plugins": true to your Unity UI package so that it can be targeted by Auto Referenced?

1 Like

OK, but the big question is: what do we need to do now in order to build our DLLs (that is, without relying on asmdefs) when they had a reference to the good old UnityEngine.UI.dll?

For Unity 2019.1 the references in my build script (which basically calls mcs to compile a pair of DLLs) are: /Contents/Managed/UnityEngine.dll and /Contents/UnityExtensions/Unity/
/GUISystem/UnityEngine.UI.dll but this no longer works for Unity 2019.2b1…

If I replace the problematic reference in my build script with \Library\ScriptAssemblies\Unity.ugui.dll (as suggested by @guavaman ) I get a lot of errors like:

  • error CS0012: The type UnityEngine.MonoBehaviour' is defined in an assembly that is not referenced. Consider adding a reference to assembly UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null’
  • error CS0012: The type UnityEngine.ICanvasRaycastFilter' is defined in an assembly that is not referenced. Consider adding a reference to assembly UnityEngine.UIModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null’
  • error CS0012: The type System.IEquatable1<UnityEngine.UI.ColorBlock>’ is defined in an assembly that is not referenced. Consider adding a reference to assembly `netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51’
  • error CS0012: The type System.Enum' is defined in an assembly that is not referenced. Consider adding a reference to assembly netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51’
  • etc…

And if I try adding a reference to the UnityEngine.CoreModule as suggested, then I get a lot of these:

  • error CS0433: The imported type `UnityEngine.MonoBehaviour’ is defined multiple times
  • error CS0433: The imported type `UnityEngine.ScriptableObject’ is defined multiple times
  • error CS0433: The imported type `UnityEngine.Object’ is defined multiple times
  • etc…

Removing the original reference to UnityEngine.dll to avoid the re-definition? Nope, that means even more errors…

So, can you please explain how to do this? I need to build my own DLLs because that’s how I distribute my editor extension since 2015.

2 Likes