There are several ways to install a Unity Package into your Unity project with the Unity Package Manager (UPM). Choose the method that best fits your workflow. For easy updates and access to future releases, we recommend using a npm scoped registry.
If the package is distributed via a public npm registry it can be easily added using the Unity Editor or manually added to the Packages/manifest.json
.
For the Package you want to install locate the following information that will be required by any of both methods.
my.scope
.https://registry.npmjs.org
.https://package.openupm.com
.Edit > Project Settings > Package Manager
.Scoped Registries
section, click the +
button to add a new registry.Save
, then close the Project Settings window.Window > Package Manager
.Packages: My Registries
from the dropdown.Install
to add it to your project.You can also directly modify your Packages/manifest.json
and Packages/packages-lock.json
files with the Name, Scope and URL:
scopedRegistries
section of your manifest.json
, example:
{
"scopedRegistries": [
{
"name": "Package Name",
"url": "https://registry",
"scopes": ["my.scope"]
}
]
}
dependencies
section, example:
{
"dependencies": {
"my.scope.package.name": "1.0.0"
}
}
If the package is available on OpenUPM it can be easily installed using the OpenUPM CLI. Make sure you have Node.js v16 or higher and the openupm-cli installed.
Run the following command:
openupm add my.scope.package.name
If the package is located in a git repository you clone it or added to your repository as a submodule under the Packages folder and Unity will recognize automatically the package. It can also be clone it outside of your project:
Window > Package Manager
.+
button in the top-left corner, then select Add package from disk...
.package.json
file.Open
to add the package to your project.If you prefer, you can directly install the package from the Git repository:
Window > Package Manager
.+
button and select Add package from git URL...
.Using this method will not show any updates or previous versions.
If you have access to the package Tarball..
Window > Package Manager
.+
button and select Add package from tarball...
.Open
.