Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Can you have packages be dependent on Asset store packages?

Discussion in 'Package Manager' started by JvanOpstal, Sep 27, 2020.

  1. JvanOpstal

    JvanOpstal

    Joined:
    Oct 12, 2016
    Posts:
    8
    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
     
    OnatKorucu likes this.
  2. samuelb_unity

    samuelb_unity

    Unity Technologies

    Joined:
    Nov 13, 2017
    Posts:
    151
    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
     
    Yany, ROBYER1, KyryloKuzyk and 2 others like this.
  3. JvanOpstal

    JvanOpstal

    Joined:
    Oct 12, 2016
    Posts:
    8
    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.
     
  4. UnityMaru

    UnityMaru

    Community Engagement Manager Unity Technologies

    Joined:
    Mar 16, 2016
    Posts:
    1,227
    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.
     
    twobob likes this.
  5. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    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"
    upload_2021-9-25_8-26-48.png
     
    Last edited: Sep 25, 2021
  6. gnp89

    gnp89

    Joined:
    Jun 25, 2012
    Posts:
    36
    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 :(
     
  7. cecarlsen

    cecarlsen

    Joined:
    Jun 30, 2006
    Posts:
    848
    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.
     
  8. dlorre

    dlorre

    Joined:
    Apr 12, 2020
    Posts:
    700
    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.
     
    Last edited: Jun 24, 2022
  9. KyryloKuzyk

    KyryloKuzyk

    Joined:
    Nov 4, 2013
    Posts:
    1,070
    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.
     
  10. dlorre

    dlorre

    Joined:
    Apr 12, 2020
    Posts:
    700
    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.
     
  11. Yany

    Yany

    Joined:
    May 24, 2013
    Posts:
    93
    @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: https://forum.unity.com/threads/add...-projects-manifest-json.1108304/#post-8608380

    You can open the Submitted idea section to see what I sent to Unity.
     
    Last edited: Nov 29, 2022
    StefanWo and cecarlsen like this.