Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

UI

Discussion in '2019.2 Beta' started by Aiursrage2k, May 6, 2019.

  1. Aiursrage2k

    Aiursrage2k

    Joined:
    Nov 1, 2009
    Posts:
    4,774
    What happend to unity UI in 2019.14. Did you completely remove unity.UI in version 14?
     
    ROBYER1 likes this.
  2. id0

    id0

    Joined:
    Nov 23, 2012
    Posts:
    266
    What are you talking about? Everything is working.
     
  3. Aiursrage2k

    Aiursrage2k

    Joined:
    Nov 1, 2009
    Posts:
    4,774
    I am talking about unity.UI in 2019.2.014a
     
  4. Yozaro

    Yozaro

    Joined:
    Jun 28, 2015
    Posts:
    49
    Do you mean UnityEngine.UI? Do you have compilation errors?
     
  5. Aiursrage2k

    Aiursrage2k

    Joined:
    Nov 1, 2009
    Posts:
    4,774
    It seemed like they completely removed it
     
  6. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    3,314
    Ugui is now a package. You should be able to find it in the package manager.
     
    Mauri, FROS7 and Jes28 like this.
  7. Sibz9000

    Sibz9000

    Joined:
    Feb 24, 2018
    Posts:
    80
    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.
     
    fherbst likes this.
  8. caitsithware

    caitsithware

    Joined:
    Feb 28, 2014
    Posts:
    10
    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:

    Code (csharp):
    1.  
    2. {
    3.     "name" : "MyAsset",
    4.     "references" : [
    5.         "MyAssetCore"
    6.     ],
    7.     "unity_2019_2_or_newer" : {
    8.         "references": [ // Proposal 1 : Overwrite
    9.             "MyAssetCore",
    10.             "Unity.ugui"
    11.         ]
    12.         "add_references" : [ // Proposal 2 : Add to default settings
    13.             "Unity.ugui"
    14.         ]
    15.     }
    16. }
    17.  
     
    sakon410 likes this.
  9. fherbst

    fherbst

    Joined:
    Jun 24, 2012
    Posts:
    134
    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?
     
  10. Abenthum

    Abenthum

    Joined:
    Mar 2, 2016
    Posts:
    9
    We have a plugin that references the UnityEngine.UI unity extension.

    Is there any way to have a plugin reference a package? :)
     
  11. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    3,314
    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.
     
  12. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    3,314
  13. Lightway82

    Lightway82

    Joined:
    Dec 19, 2018
    Posts:
    10

    I updated the editor to version 2019.2.0b1( last 2019.2a14):
    Code (CSharp):
    1. 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.
     
  14. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    3,587
    hub.PNG
     
  15. Lightway82

    Lightway82

    Joined:
    Dec 19, 2018
    Posts:
    10
    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.
     

    Attached Files:

    Last edited: May 11, 2019
  16. ArthurT

    ArthurT

    Joined:
    Oct 26, 2014
    Posts:
    69
    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?
     
    Mullan7 likes this.
  17. BonneCW

    BonneCW

    Joined:
    Jan 22, 2017
    Posts:
    31
    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.
     
  18. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    3,666
    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.

    2019_2_ugui_dll.png
     
    echeg, ROBYER1 and SugoiDev like this.
  19. caitsithware

    caitsithware

    Joined:
    Feb 28, 2014
    Posts:
    10
    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?
     
    sakon410 likes this.
  20. _xeleh_

    _xeleh_

    Joined:
    Jul 22, 2016
    Posts:
    255
    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: <Unity-app>/Contents/Managed/UnityEngine.dll and <Unity-app-path>/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 <project-path>\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.IEquatable`1<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.
     
    Last edited: May 13, 2019
    ROBYER1 likes this.
  21. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    65
    Having the same issue with the SteamVR plugin after updating to this beta, all references to UnityEngine.UI break!
     
  22. phil-Unity

    phil-Unity

    Unity UI Lead Developer Unity Technologies

    Joined:
    Nov 23, 2012
    Posts:
    1,134
    So i dont have answers for you right now. The DLL issue is defiantly something we overlooked. We realized our mistake and are working to come up with a solution that will minimize and issues though still unsure what that will look like. Once we have something we will let you know.
     
    caitsithware, FROS7, ROBYER1 and 3 others like this.
  23. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    3,666
    I hadn't actually tested it. I just assumed it work work. Good to know it doesn't.
     
  24. rastlin

    rastlin

    Joined:
    Jun 5, 2017
    Posts:
    88
    You get the "defined multiple times" error because most probably you are referencing monolithic UnityEngine dll which is packed with all the modules. Unity moved to package-based dll's a while ago, you should remove the reference to the monolith, and include individual packages that you need.

    Your initial approach was correct, just remove the reference to monolith.
     
  25. _xeleh_

    _xeleh_

    Joined:
    Jul 22, 2016
    Posts:
    255
    Yes, that is exactly the reason.
    I tried that but in my case (a large code base covering a lot of Unity modules) it is not as easy as manually adding the references to a few individual packages. That's why I was asking if there was a proper (and easier) way of doing this.

    After some study -I confess I knew nothing about asmdefs- I found an apparently working solution to build the DLLs from a custom build script:
    1. Add an assembly definition file to your source folder and configure the reference to the new UI package (Unity.ugui).
    2. Let Unity create the corresponding .csproj file for the defined assembly (Assets > Open C# Project menu option).
    3. This .csproj will contain every reference you need, so you can now call msbuild <csproj-file> from your build script to build the DLL.
    The default output dir will be <project>/Temp/bin/Debug/ but this can be changed by adding -p:OutDir=<output-path> argument when invoking msbuild.

    I hope this can be useful to someone else. In my case it matters because my project has some special build requirements. For "normal" projects you will probably be good just by relying on a properly configured asmdef and the generated DLL in <project>/Library/ScriptAssemblies.
     
    Last edited: May 31, 2019
  26. phil-Unity

    phil-Unity

    Unity UI Lead Developer Unity Technologies

    Joined:
    Nov 23, 2012
    Posts:
    1,134
    So as promised about keeping you guys in the loop i'll tell you our current plan of action which is two step that will happen at the same time.

    1) We will break our package naming consistency and rename the package to be UnityEngine.UI. This will allow unity to compile the package as UnityEngine.UI.dll so any prebuilt assemblies will continue to work.

    2) For 19.2 we will automatically compile asmdefs with the UI reference. This way there shouldn't be a need to manually add the reference yourself. For 19.3+ we are hoping to have a more robust system in place but we are still unsure what this will look like.

    For timing, we are hoping to get this completed end of next week (Holidays/ training for required team members has pushed the fix back) though that is if nothing else comes up in the mean time. i *think* this means it will land b3, maybe b4 for 19.2.
     
    guavaman, ROBYER1, Jes28 and 8 others like this.
  27. Abenthum

    Abenthum

    Joined:
    Mar 2, 2016
    Posts:
    9
    Thanks, phil!
    Do you have n migration path for _xeleh_'s use case above? Building a plugin DLL referencing the UnityEngine.UI.dll package?
    Up until 2019.2.0a14 I could build our plugin solution, referencing the monolithic UnityEngine.dll and the old UnityEngine.UI.dll (and my understanding was that plugin solutions /should/ in fact reference the monolithic DLL).
     
    Last edited: May 14, 2019
  28. phil-Unity

    phil-Unity

    Unity UI Lead Developer Unity Technologies

    Joined:
    Nov 23, 2012
    Posts:
    1,134
    So i have heard back from one of our scripting guys about the proper process.

    "The user should reference the .dll that Unity builds and the `UnityEngine.*Module.dll` that are are required, which I think are the same ones as the one the uGUI .asmdef depends on and you have to add to Unity package manager when referencing uGUI package. Unity .asmdefs are built against the `UnityEngine.*Module.dll` and any precompiled assembly that reference .asmdef built assemblies must also reference them."

    `UnityEngine.*Module.dlls` reference modules like `UnityEngine.CoreModule.dll`, or `UnityEngine.AnimationModule.dll`, ect. They way _xeleh_'s did it where he let Unity set up the csproj might be the easiest to not miss any required.
     
  29. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,169
    Just in case you still need help with this, since I just had to go through the same thing and luckily found this thread straight away:

    Go into SteamVR folder in your project asset browser
    Click on SteamVR.asmdef
    In the inspector, press the plus icon in the Assembly Definition References section
    Now you have a new empty slot there, press the select icon next to it and choose Unity.ugui
    Press the apply button
    Various things should now compile and the SteamVR window appears.

    Dont ask me if everything actually works after this step, or if I did everything correctly, I just got that far and thought I would let you know. Its been some years since I used the SteamVR plugin so I'm very rusty, just getting back into it now!
     
    ROBYER1 likes this.
  30. recursive

    recursive

    Joined:
    Jul 12, 2012
    Posts:
    546
    Is this fixed in b3? It's not obvious from the release notes.
     
  31. phil-Unity

    phil-Unity

    Unity UI Lead Developer Unity Technologies

    Joined:
    Nov 23, 2012
    Posts:
    1,134
    No this did not land in b3. We are still working on getting the fix through the pipeline. We are looking at it being finalized end of the week and thus into release next week or the week after.
     
    FROS7, ROBYER1 and recursive like this.
  32. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    65
    Thanks for this, as I'm a bit of an amateur programmer, sometimes something as simple as searching for an renaming references goes over my head. It sure isn't a long-term fix but fine for now, thanks :)
     
    Last edited: May 24, 2019
    elbows likes this.
  33. recursive

    recursive

    Joined:
    Jul 12, 2012
    Posts:
    546
  34. phil-Unity

    phil-Unity

    Unity UI Lead Developer Unity Technologies

    Joined:
    Nov 23, 2012
    Posts:
    1,134
    Hey unfortunately no currently according to release management its on target for b6. Its later then i would have liked but got the other part of the fix from a colleague Monday and have hit some regressions in our test suite that needed resolved so missed the cut off which was Tuesday for b5.
     
    karl_jones, alexr1221 and recursive like this.
  35. julian-moschuering

    julian-moschuering

    Joined:
    Apr 15, 2014
    Posts:
    309
    @phil-Unity - When will the fix for precompiled assemblies get included in the 2019.3 alpha?
     
  36. phil-Unity

    phil-Unity

    Unity UI Lead Developer Unity Technologies

    Joined:
    Nov 23, 2012
    Posts:
    1,134
    It has landed and is marked for the a6 release.