Skip to content

Latest commit

 

History

History
97 lines (76 loc) · 3.8 KB

AlternativeDestributionOptions.md

File metadata and controls

97 lines (76 loc) · 3.8 KB

NPMJS

image

NPMJS is the most popular Package destribution portal in the world. It is used for any packages from different programming areas of knowledge. We are interesting in using the platform for having dependencies on Unity packages only and publishing our own. It is free to use and work very well for my opinion.

Pros

  • Ultra fast deployment
  • Easy creation of new versions
  • Unity Package Manager supports versioning from NPMJS
  • Trusted platform by huge community

Cons

  • Need to create account and authorize once



OpenUPM

image

Popular in Unity community platform for package destribution. Created as open sourced project for helping people to destribute their packages.

Pros

  • Made especially for Unity
  • No registration needed
  • Package can be deployed directly from GitHub repository

Cons

  • Long deployment duration (10 - 60 minutes)
  • Small community (in comparison to other options)



GitHub Packages

image

Amazing GitHub feature, also Unity support it

Pros

  • Ultra fast deployment
  • Trusted platform by huge community

Cons

  • Does not support version fetching, it means you can't see when new version of the package is available in UPM. To install new version you should manually change the version in a project.



GitHub Repository

image

Unity UPM support direct GitHub links to public repositories for using them as a package. The only required thing - the link should point on a folder which contains package.json file.

Pros

  • no special steps required, just use your public repository as a package in UPM

Cons

  • Does not support version fetching, it means you can't see when new version of the package is available in UPM. To install new version you should manually change the version in a project.



How to use

  • "Use this template" green button at top right corner of GitHub page

  • Clone your new repository

  • Add all your stuff to Assets/_PackageRoot directory

  • Update Assets/_PackageRoot/package.json to yours

  • (on Windows) execute gitSubTreePushToUPM.bat

  • (on Mac) execute gitSubTreePushToUPM.makefile

  • (optional) Create release from UPM branch on GitHub web page for support different versions

alt text

How to import your package to Unity project

You may use one of the variants

Variant 1

alt text

Or you may use special version if you create one

https://github.com/USER/REPO.git#v1.0.0 Dont forget to replace USER and REPO to yours

Variant 2

Modify manifest.json file. Change "your.own.package" to the name of your package. Dont forget to replace USER and REPO to yours.

{
    "dependencies": {
        "your.own.package": "https://github.com/USER/REPO.git#upm"
    }
}

Or you may use special version if you create one

Dont forget to replace USER and REPO to yours.

{
    "dependencies": {
        "your.own.package": "https://github.com/USER/REPO.git#v1.0.0"
    }
}