使用 Unity Package Manager(在 Unity 顶部菜单中:Window > Package Manager)可查看哪些包可供安装或已经安装在项目中。此外,还可使用此窗口查看哪些版本可用以及为每个项目安装、移除、禁用或更新包。
Package Manager 窗口显示以下内容:
(A) 添加 按钮,单击此按钮即可直接通过此窗口安装包到您的项目中。
(B) 包范围下拉菜单,可用于筛选要在列表中显示的包。
(C) Advanced 按钮,通过单击此按钮,除了显示已经验证能够用于 Unity 的包之外,还可显示预览包。
(D) 搜索框,可用于按名称查找包。
(E) 包列表视图,显示与您指定的筛选条件和搜索参数匹配的所有包。
(F) 特定于包的详细信息视图,显示特定于列表中所选包的信息。
(G) 状态栏,显示有关包加载状态的消息和有关网络的警告。
(H) 重新加载 按钮,单击此按钮可强制 Package Manager 重新加载您的包。
(I) 用于安装或更新包的按钮(如果所选版本已经安装,则显示 Up to date 消息。)
(K) 清单 按钮,单击此按钮可在 Inspector 窗口中显示 package.json 清单文件。如果这是本地包或嵌入式包,则可以直接在 Inspector 中编辑;否则将为只读。
Advanced 下拉菜单允许您执行以下操作:
下拉菜单项 | 操作结果 |
---|---|
Reset Packages to defaults | 选择此选项可恢复为 Unity Package Manager 的默认设置。 警告:这将从项目清单文件中删除所有自定义项。仅当无法确定项目清单文件出了什么问题时,才应使用此选项作为最后的手段。 |
Show dependencies | 在详细信息视图中显示每个包的依赖项。 |
Show preview packages | 在包列表中包含预览包。 注意:预览包未经验证是否能够用于 Unity,并且可能不稳定。实际生产环境中不支持预览包。 |
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.