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 i create my own Package that can be imported and updated accordingly ?

Discussion in 'Package Manager' started by Aladine, Feb 6, 2021.

  1. Aladine

    Aladine

    Joined:
    Jul 31, 2013
    Posts:
    194
    Hi,

    I'm basically looking for a git submodule solution but with unity package manager, the short story is this:

    Every project i made consist of 3 main folders:

    1. TheGame: assets and code that are 100% specific to this game.
    2. Universals: mostly codes and shaders but also some assets that i know i will be re-using over and over for now projects.
    3. ThirdParties: assets from the asset store and other sources
    What i want is to simply find a way to import the "Universals" folder through the package manager, this also mean that when i open the main project that contain the Universal folder and update it, i want the package manager to be "aware" of that.

    What are my options to achieve this ?

    Thanks!
     
  2. Davidtr_Unity

    Davidtr_Unity

    Unity Technologies

    Joined:
    Mar 5, 2020
    Posts:
    34
    Hi, a good solution if you're working locally would be to turn the “Universals” folder into a local package. This way, every time you update something in that folder, it would get re-imported in all of your projects through the package manager.

    You can follow the steps documented in our doc to convert your folder into a local package. After you’re done, you can import your package by clicking on the Add package from disk button in the package manager window.

    I hope this was helpful to you
     
  3. Xarbrough

    Xarbrough

    Joined:
    Dec 11, 2014
    Posts:
    1,184
    You can also make Universals a Unity package manager package and then host it on GitHub. It can be added to new projects like any other Unity package this way.

    If you don't like GitHub, you can also use any NPM compatible hosting solution, either locally (e.g. your own Verdaccio server) or any online solution that has the same protocol.

    Remember, however, that the Universals folder will not update automatically, you will always have to trigger a manual update after you push a change to the package repository.