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

Question Packaging assets for reusability and maintenance

Discussion in 'Asset Importing & Exporting' started by g4ma, Jun 21, 2022.

  1. g4ma

    g4ma

    Joined:
    Dec 18, 2018
    Posts:
    32
    Hi!

    I am working on a project spanning multiple Unity projects (think for instance multi-episodes).
    As we have many shared assets between projects we rely a lot on packages - for instance one package for a big prefab that itself pulls many asset as dependencies (models, textures, etc.)

    Our question is: what is the best format for those packages?
    - initially we were obviously thinking about .unitypackages but those are more like fire-and-forget packaging for quickly exchanging data. As they are monolithic files it does not make sense if for instance we just upgrade 1 texture among 2GB of other data pulled by the prefab we are packaging. So it does not look great for an iterative process where the package might regularly get updated.
    - Considering this we moved on to a simple "loose files" scheme: we copy all the files into a dedicated folder (that might be shared, for instance on a repository), we generate a valid package.json file, and that's it - our users on the editor side can simply reference it through Unity Package Manager.
    - A nice evolution of the above system would be to actually create NPM packages that we could upload to a NPM server - it's just that right now we don't have one set up yet.
    We do this for our code already - tools etc. and are wondering if this would scale with multiple 100MB-1GB assets.

    So is this the best solution? As there better ways to solve this problem? Any experience with this yet?
     
    CodeSmile likes this.
  2. bastien_humeau

    bastien_humeau

    Unity Technologies

    Joined:
    Jun 14, 2017
    Posts:
    176
    That's definitely the solution I'd go with.
    You can even move that later to your own npm hosted solution using Scoped Registry in the package manager, which will help you to lock projects on specific packages version, etc... while working on multiple projects.
    If you have any further questions regarding the package manager, you should ask directly in this section of the forum https://forum.unity.com/forums/package-manager.150/
     
  3. g4ma

    g4ma

    Joined:
    Dec 18, 2018
    Posts:
    32
    Thanks for your answer!
    We are definitely planning to host our own npm solution. But before coming there it's good to know this option looks like a good one.