Version: 2023.1
Install a package from a registry
Install a package from a local tarball file

Install a package from a local folder

Package Manager 可以从计算机上的任何位置加载包,即使您将包保存在 Unity 项目文件夹之外(例如,如果您有一个名为 com.unity.my-local-package 的包,并且保存在 Desktop 上,但您的 Unity 项目位于 Documents 文件夹下面)。

您也可以使用项目文件夹中的文件夹,只要不是其中一个保留的项目子文件夹即可。

To install a package from your local disk:

  1. Open the Package Manager window, if it’s not already open.

  2. Click the install button in the toolbar. The options for installing packages appear.

    Install package from disk button
    Install package from disk button
  3. Select Install package from disk from the install menu to bring up a file browser.

  4. 导航到本地包的根文件夹。

  5. 在文件浏览器中双击 package.json 文件。

The file browser closes, and the package now appears in the package list with the label.

A package installed from a local folder, with the option to update to a higher version
A package installed from a local folder, with the option to update to a higher version

请注意,如果更新为注册表版本,而您在本地对项目进行了更改,则注册表版本将覆盖本地更改。

项目中的本地包

可将本地包放在项目内部的任何位置,但以下文件夹除外:

项目文件夹: 原因:
Assets 如果将包放置在此文件夹中,则资源数据库会将该文件夹下的任何资源导入两次:一次作为资源,一次作为包内容。
Library 请勿修改此文件夹的内容。
ProjectSettings 此文件夹仅用于设置资源。
Packages 如果将包放在此文件夹下,则无论项目清单中的引用如何,Package Manager 都会自动将这个包解释为__嵌入式包__。


Install a package from a registry
Install a package from a local tarball file