Version: 2019.1
Unity 的 Package Manager


本节介绍有关 Unity Package Manager 功能的许多概念:


Multiple versions of each package are available, marking changes to that package along its life cycle. Every time a developer updates the package, they give it a new version number. A change in package version tells you whether it contains a breaking change (major), a new backward-compatible functionality (minor), or bug fixes only (patch), following Semantic Versioning.




  • 项目清单 (manifest.json)。项目清单存储 Package Manager 在查找和加载正确的包时所需的信息,并列出声明为依赖项的包和版本。
  • 包清单 (package.json)。包清单存储有关特定包的信息,并列出该包所需的包和版本。

这两种文件都使用 JSON(JavaScript 对象表示法)语法。


Unity maintains a central registry of official packages that are available for distribution. A package registry stores package contents and information (metadata) on each package version. By default, all Projects use the official Unity package registry, but you can add additional registries to store and distribute private packages or stage packages in development.


Unity Package Manager 是管理整个包系统的工具。此工具的主要任务包括:

  • 与 Unity 注册表以及您指定的任何其他注册表通信。
  • It reads your Project manifest and fetches package contents and metadata.
  • It installs, upgrades, and uninstalls packages, whether they are dependencies of the Project or one of the installed packages.
  • 启用和禁用 Unity 的内置包。
  • 显示有关每个包的每个版本的信息。
  • It resolves conflicts when the Project and its packages require more than one package version.

The Unity Package Manager installs samples, tools, and Assets on a per-Project basis, rather than installing them across all Projects for a specific machine or device. It uses a read-only global cache to store downloaded package metadata and contents. Once installed, Unity treats package Assets just like any other Asset in the Project, except that these Assets are immutable (read-only). You can only change Assets from Local and Embedded package sources.

Package states

States indicate where the package is in the development cycle:

状态 描述
开发中 (In Development) The package developer is still creating the package. Usually this corresponds to having the package embedded in the developer’s Project.
预览 (Preview) The package is ready to use and can appear in the package registry, but it is not ready for use in production. This stage is like a beta cycle.
Production-ready The package is safe to use in production and the developer has published it to the package registry.
已验证 (Verified) The package has undergone testing and has been verified to work safely with a specific version of Unity, and all other packages verified for that version.

The Package Manager window displays a tag that corresponds to some of these states. For more information, see Tags.



来源 描述
注册表 The Unity Package Manager downloads most packages from a package registry into a global cache on your computer as you request them. These packages are immutable (read only), so you can use them in your Project, but you cannot modify them or change their package manifests.
内置 These packages allow you to enable or disable Unity features (for example, Terrain Physics, Animation, etc.). They are immutable (read only).
嵌入式 Any package stored inside your Project folder is embedded. This source corresponds with the in development state because you typically put all the scripts, libraries, samples, and other Assets your new package needs in a folder under your Project folder when you begin development on a package.
本地 可从计算机上的任何文件夹中安装安装包(例如,如果在本地克隆了开发代码仓库)。
Git Package Manager 直接从 Git 代码仓库安装 Git 包,而不是从注册表服务器进行安装。


Package Manager 窗口会显示与上述某些来源对应的标签。有关更多信息,请参阅标签

Unity 的 Package Manager