I have a repo of generally useful code that I like to bring along to most new projects and making it a custom package seems like a perfect fit. The only obstacle is that a fair amount of the code is dependent on some plugins that I use extensively (Odin and DOTween). It would be lovely if I could just add my module through the package manager and have it resolve automatically.
Seeing as with 2020 onwards Asset packages are also included in the package manager I was hoping I could setup the dependencies like any other package, but they are still imported the old fashioned way, directly into the Assets folder.
Is there a way to add them as dependencies for a custom package anyway? Where would I find the equivalent of âcom.unity.modules.uiâ: â1.0.0â for Asset packages?
The short answer is UPM (Unity Package Manager) packages and the legacy Asset Store packages (.unitypackage format) are not compatible - you cannot have a dependency on a .unitypackage. The long term goal is for the Asset Store to move to the new UPM format so one day youâd be able to add a dependency on your favourite Asset Store packages. Another feature in the pipeline is custom templates so just like the 2D and 3D templates you can choose when starting a new project, you could create your own template which is a skeleton project with some assets (in theory including a .unitypackage thatâs been imported into Assets). But as of today, the scenario you describe isnât really possible without a hacky workaround. For example, you could move everything you want into a local UPM package which at least means you only have to add 1 thing when starting a new project but I have not tested this and Iâm not sure if it would even work with different namespaces inside the local package. Sorry about that!
Thanks for the response!
That makes sense, I was afraid that was the case. I look forward to seeing the next steps for UPM!
Since I started packagifying my modules I came upon a second point of the packages that would be great if it could be improved upon in the future: making it possible to annonate the git-url in a dependency.
I can see that the manifest file in a Unity project uses a very similar notation to the package.json files for the packages, but with the addition of an alternative to the dependency notation:
where in the packages you are constrained to this:
âcom.unity.modules.uiâ: â1.0.0â
The manifest also includes this, when I add a custom package:
Is similar functionality in the pipeline for the UPM? The current version already works great to communicate what the dependencies are for a given custom package, but if it could automatically pull them into the project that would be amazing.
It looks like youâre talking about the packages having dependencies on Git packages. This is in our backlog but not something that will be available anytime soon.
Also would dearly love to reference extant DLLâs in the project. Doubtless the technical details make it all very impossible but honestly, on the face of it, it is not really /clear/ why we canât simply reference the dllâs.
Any clues why itâs so hard? And please add my name on the âsupport .unitypackages dll being referenced by DLLâ list
The point is: one of you said âin our backlogâ and the other said âThe long term goalâ a year ago. I know in corporate time that is a blink. However my point is that extant developers with Packages on the /store/ may well never update their stuff to be a Package (as me how I know) leaving us stuck without your side in that solution for âThe long term goalâ to make it âout of your backlogâ
EDIT: I really hope you reply and say âDUH we did this alreadyâ
Been trying to migrate to Packages for the last 3 years and there are always blockers like thisâŚ
Please put some more effort in UPM if you want the community to make a real adoption of this technology, that looks amazing in theory, but itâs still a pain to use un practice
Years ago I started to adapt a lot of my assets to the UPM format in the hope they would some day be able to reference each other on Asset Store. The workarounds Iâve seen so far are not very satisfying.
Isnât this package an UPM package? I imported it and it gave the choice between installing the required dependencies, or creating a temp project, can I do the same?
ETA: it looks like it is a full project, because I see Packages/manifest.json in the files tree.
No, itâs not. This package was exported with âinclude dependenciesâ checked, which only suites for exporting the whole project. Generally, this setting itâs not suitable for regular assets sold on the Asset Store because it will mess up the existing projects.
Yes I figured it was a full project. I am creating a package dependant on Localization and Input System and having an InputActions script without the Input System installed will trigger errors. I found a workaround but Iâd rather have the installer popup a prompt asking whether the Input System should be installed.
Iâm extremely curious here at the end of 2022 whether this feature is implemented already or will it be any time soon? Namely: I create an asset to the Asset Store and define somewhere which other Assets are needed from the store to have full functionality.
It is strange that UPM already has a dependency feature and Asset Store packages now already use the UPM, but I could not find any official nor unofficial document if I can use that for a package targeted to the Asset Store.