I have spent over 4 hours banging my head and keyboard on google trying to figure out why “using unityengine.ui;” doesn’t work anymore for Unity 2019.2. I found out it was deprecated. I did not know that and now I wish I didn’t upgraded to 2019.2 because the documentation for 2019.1 still has those coding references and 2019.2 doesn’t. I have read they have moved it as a package and some people are happy about it. But no one can tell me how to fix it is my main problem right now. That problem is how get access that library because the using statement doesn’t work anymore. Because they moved it to a package, I have been googling how to reference this package in my code but getting no where. No I am not using the Alpha or Beta Version.
Have been working with Unity 2019.2 on a daily basis since it was first released and I’m not having any of the troubles you describe here. Check the package manager for your project (Window → Package Manager). If there isn’t anything in the package manager then I’d suggest resetting your project’s packages by clicking Advanced → Reset Packages to Defaults.
Package Manager in Unity 2019.2
Alternatively you can navigate to the packages documentation by going to the manual, expanding Packages in the side bar, and then expanding Built-in Packages. Click the one you want to check and then on the page that loads click the version. It’s totally convoluted.
The Packages are installed for the project. Yeah Right. Which I have found out now. The Packages folder on each package is empty in the project folder. What unity is doing is getting it from another source not the project it’s self. Hench why the namespaces are not registering. Now this is a clean project from scratch for 2019.3 Full Release. So how to we go about fixing it as copy and pasting does some weird things to the packages say it is not for production use. Anyone have this issue?
Although some users may find the change useful (?), it doesn’t really help when creating libraries in Visual Studio which, out of preference, I’ve always installed as a separate entity
This is probably a stupid question, but I have to ask: you explicitly wrote that you use "using unityengine.ui;". Is this really exactly as it is typed in your code (i.e., lowercase)? The correct, case-sensitive line should be using UnityEngine.UI;
I solved it by creating a new Unity project. I export the assets from the old project (creating prefabs of terrain and game objects I had created) and imported them in the new project.
Try creating a new Unity project, make a C# script and try to use UnityEngine.UI in the new project. If you don’t get the error message, you should be able to solve the problem the same way I did.
Ok, ok, ok…I’m about 2 hours banging my head against the keyboard and I got lucky. I’m surprised no one suggested this option yet…but my problem may have been slightly different.
I was separating my project into different assemblies (creating a .asmdef file) and suddenly lost all my UnityEngine.UI references…
Currently using 2019.3.0a3.
If you look through the Packages folder there is : Packages\Unity UI\Runtime*Unity.ugui*.asmdef
I was looking for UnityEngine.UI and it wasn’t there. However, if you add a reference to Unity.ugui in the references section of your .asmdef file, then in your scripts, the code “using UnityEngine.UI” works!