A “package” is a container that stores various types of features or assets, such as:
Packages deliver a wide range of enhancements to Unity through the Package Manager. To help find and use these packages, the Package Manager window provides collections of packages that you can use together, called “feature sets”. In the Editor, you can access the Package Manager window through this menu: Window > Package Manager.
注意:Package Manager 还支持查看您已经从 Unity Asset Store 下载或导入的任何 Asset Store 资源包。
Unity 打开项目时,Unity Package Manager 会读取项目清单文件 (1) 以确定要在项目中加载的包。然后会向每个包(在清单中显示为依赖项)的包注册表服务器 (3) 发送一个请求 (2)。包注册表将请求的信息和数据发送回 Package Manager (4),然后由 Package Manager 将这些包安装到项目中 (5)。每个项目都有其自己的清单,清单中列出了要作为项目的“依赖项”加载的包。
如果要在项目中包含某个包,则必须更新项目清单以将该包包含在依赖项列表中。如果需要,可以直接修改项目清单,但是让 Package Manager 执行此操作会更安全、更轻松。有关使用用户界面的更多信息,请参阅 Package Manager 窗口的文档。
Package Manager 使用三个界面与用户、清单和注册表进行通信:
界面方法 | 如何使用 |
---|---|
用户界面 | 可使用 Package Manager 窗口来快速浏览和搜索功能。还可以轻松地选择要安装和更新的包,并解决包依赖关系中的冲突。Package Manager 提供了一个用户界面,可用于直接更改项目清单。 |
包清单 | Package Manager 在 Unity 中提供了一个专用 Inspector,可用于查看任何包的清单,同时,清单会成为 Project 视图中的主要内容。此集成意味着还可以直接在 Unity 中为嵌入式或本地包编辑包清单。 |
脚本 API | Package Manager 脚本 API 让用户能够以编程方式与 Package Manager 进行交互。可以用来查询包注册表,安装、嵌入和删除包,以及使用各种条件列出包。 |
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.