Can you have packages be dependent on Asset store packages?

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?

Thanks in advance,

Jordy

1 Like

Hi @JvanOpstal ,

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!

Sam

7 Likes

Hi @samuelb_unity ,

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:

“com.[myCompany].[packageName]” : “https://github.com/[my-repo-url]”

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.

Hello!

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.

1 Like

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 :frowning:

1 Like

How is it going with that, 1,5 years later?

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.

@samuelb_unity

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.

Since then… I found this other thread about the same thing: Adding a dependency to an asset store product in a project's manifest.json? - Unity Engine - Unity Discussions

You can open the Submitted idea section to see what I sent to Unity.

4 Likes