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

Correct way to upload packages

Discussion in 'Package Manager' started by Smileys, Aug 2, 2022.

  1. Smileys

    Smileys

    Joined:
    Feb 27, 2014
    Posts:
    81
    Hi, i have some trouble understanding the correct process of uploading a Package to the Asset store, that is then imported in the Packages folder.

    I followed the Tutorial here:
    https://docs.unity3d.com/Manual/upm-embed.html
    and decided to setup my working directory in the Assets folder rather than the Packages folder because it is much easier to work with (mainly because i like to have the Project Window Search working in Unity itself).

    My folder structure is as far as i know correctly setup and imports just fine when i create a new project and use the Package Manager to import it from a local source. I was under the assumption (because it is not mentioned in the Manual), that my Package will be imported into the Packages folder when i provide a "package.json". However - now that my Asset is available on the Asset store, it imports into the Assets folder - ignoring everything Package Manager related.

    So my question is - whats the correct way of dealing with this?
    Am i supposed to just work in the Packages folder? Do i miss something?
    And why is the Asset Store Tool not warning me like: "Hey you have a package.json in your Asset - do you want this to be a Package instead of a folder importing to Assets"
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    4,060
    No, packages are packages. Whatever you have under "Assets" are, well, assets. You have to set up the package so it is installed via Package Manager.

    As for searching, as well as a number of other things (ie unit tests, asset selection) you can mark the package as "visible" in the Unity editor by editing the JSON or the package.json via Inspector, so the json has this line in it:

    Code (CSharp):
    1.   "hideInEditor": false
    I work using packages, with each package in its own github repository (without a Unity project). That way I can just import them wherever I need them, and I can work on them in any Unity project because everything in the package is in a single (local) folder where the github repository is cloned. This makes switching editor versions (for testing) trivial once you've set up a project for each major Unity version (2020.3, 2021.1 and so on).

    I even have a "dev" package where I store all my prototyping stuff, temporary assets, etc. so the individual projects aren't cluttered with unused assets.
     
    Smileys likes this.
  3. Smileys

    Smileys

    Joined:
    Feb 27, 2014
    Posts:
    81
    Hey, thanks for the answer.
    "You have to set up the package so it is installed via Package Manager."
    So how do you do that. From the manual i was under the impression that i have done exactly that already. What i do is similar to what you are doing.
    I have a GIT repository folder that is located in the Unity Project where i am "developing". This is the lowest supported version right now. Then i have a project for each major Unity Editor version where my Package is installed via the Package manager (locally). Everything works just fine.

    I am just confused on how you would upload the Repository folder where all your stuff is in, so that it appears in the Packages directory instead of anywhere else.

    Do you upload it from a project where the Package is installed locally ?
    iE: Your tool is in C:/MyTool , then you have a Unity Project in C:/Unity/MyProject. In that Project you locally install your package and the Asset Store Tools and upload it ? The whole process feels really opaque and not very well documented for me. Or maybe i am just too stupid to find enaugh info on that.
     
  4. Smileys

    Smileys

    Joined:
    Feb 27, 2014
    Posts:
    81

    Bump - i setup everything like you said. Now i am getting a Path error telling me that the Package needs to be in a Project. The Package is locally installed through the Package manager but not located in the Projects directory. I am searching the web for hours - there are only guides on how to upload Assets. I cant find a single step by step / best practices guide on how to upload a Package that is installed into the packages folder. It gets worse because they use the wording "Package" for basicly everything without differentiating between a folder in "Assets" and a Package (with package.json etc) in the Packages folder that is managed by the Package manager. What am i missing ? Do i need to put my package folder into the Projects /Packages directory ? I dont want to do this by try and error since my product is already out in the open and on top of that every update takes days to review.
     

    Attached Files:

  5. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    4,060
    I haven't uploaded any packages to the store yet. But it's normal for Asset Store assets to be imported under Assets even though they are packages. Or maybe the concept of Package Manager packages differs from Asset Store "packages"?

    I didn't give the process much thought, assuming it was straightforward once you have made a Package Manager package.
     
  6. Carwashh

    Carwashh

    Joined:
    Jul 28, 2012
    Posts:
    746
    Asset Store ...assets... aren't packages, in a package.json kind of way. The package manager is just the delivery method for them, they still use .unitypackge
     
  7. Smileys

    Smileys

    Joined:
    Feb 27, 2014
    Posts:
    81
    So theres no way to deliver a "Package" through the asset store? How does ie. TMPro etc do it ?
     
  8. Carwashh

    Carwashh

    Joined:
    Jul 28, 2012
    Posts:
    746
    There could be, I haven't looked into it. But it's not straight forward. You'd probably have to have your asset uploaded as an installer that then adds the package to the package manager (like Vuforia does). Though I do not know what is allowed.

    TMP isn't on the asset store, it's a Unity package - you get it from the package manager, not 'My Assets'.
     
  9. Smileys

    Smileys

    Joined:
    Feb 27, 2014
    Posts:
    81
    Thanks - i think just deploying everything as Assets will be the way to go then. Was just not aware about this as everything in the manual makes you think that your "Packages" will be deployed as "Packages" and not Assets.
     
  10. Carwashh

    Carwashh

    Joined:
    Jul 28, 2012
    Posts:
    746
    The link in the OP isn't talking about uploading assets for the asset store. It's talking specifically about uploading custom packages.

    You have to use the Asset Store Publisher tools to upload assets.
    https://assetstore.unity.com/packages/tools/utilities/asset-store-publishing-tools-115
     
  11. Dream_Code_TM

    Dream_Code_TM

    Joined:
    Jul 19, 2013
    Posts:
    37

    Attached Files:

    • 1.png
      1.png
      File size:
      157.3 KB
      Views:
      125
  12. Carwashh

    Carwashh

    Joined:
    Jul 28, 2012
    Posts:
    746
    No, the only way to do it is via the publishing tools.

    The Unity Asset Store may download via the Package Manager, but they're not "packages". They don't use a package.json, they're still archvied up as a .unitypackage, so when a customer imports the asset it extracts into the same folder structure as you uploaded from.
     
  13. fipsy

    fipsy

    Joined:
    Sep 3, 2016
    Posts:
    13
    It is now possible and officially supported by Unity to upload packages from the Packages folder. You have to use Needle's Hybrid Packages.
    You can find more info on how to do it here: https://github.com/needle-tools/hybrid-packages
     
    CodeRonnie, cecarlsen and CodeSmile like this.
  14. Dream_Code_TM

    Dream_Code_TM

    Joined:
    Jul 19, 2013
    Posts:
    37
    ok thx i try it