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 Managing a suite of Asset Store packages (best practices?)

Discussion in 'Package Manager' started by Kazko, Feb 16, 2023.

  1. Kazko

    Kazko

    Joined:
    Apr 2, 2014
    Posts:
    82
    Hello, I am developing several editor tools for the Asset Store as individual packages. While the packages do not depend on each other, some of them share several core scripts - for example each package has a settings asset (an implementation of a base settings class), or some static helper methods.

    TLDR - How to setup / structure the package so that they can share the core scripts, but retain convenience of internal git editing / versioning?

    Currently, for convenience, I develop them all in the same project with folder structure:
    DeveloperName/SuiteName/PackageName
    + DeveloperName/Core - folder for the common scripts

    Is it possible to make the core as a dependency for the individual packages? What other practices are used in such situations?

    Thanks for any insights or ideas!
     
  2. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    1,869
    I have seen multiple assets just include the latest Core in each of their sellable asset packages. As long as the names and .meta files are actually the same, this works out okay. During import, even if they moved their folders around, the package manager can update the existing files. You have to be super careful to not update your Core introducing incompatibilities, or to advise your customers to do a clean re-install with the newest package version(s) if they have more than one of your suite.
     
    Kazko likes this.
  3. Kazko

    Kazko

    Joined:
    Apr 2, 2014
    Posts:
    82
    Thanks for the reply. I have thought of this but it seemed like a problematic option in regards to where the Core is placed. Shouldn't it be placed outside/above the PackageName folder?

    If it is inside, then there would be multiple copies if user installs two packages. Or would the manager resolve this?

    If above, it would work, but uploading and managing becomes harder because in the uploader we can not specify which folders to include. In this case, "DeveloperFolder" would be the one to choose to upload, all other packages and their folders would need to be placed outside before the upload.

    Can you please recall specific packages which used this approach? I would take a look at them. Thanks!
     
  4. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    1,869
    Your directory names look fine for this approach. Yes, the Import process for packages will match assets anywhere in the user's directory structure if the .meta file and filenames match. That's mostly what the .meta is for, it has a permanent unique identifier for every asset so that moving assets doesn't break stuff constantly. If I move your DeveloperFolder into Plugins/ArtistTools/Graphics/DeveloperFolder, then you come out with an update, the importer will show "oh, you moved it, okay, wanna overwrite that or no?"
     
    Kazko likes this.