项目的 Packages
文件夹下出现的所有包都是嵌入在该项目中的。通常,在创建一个新包时,您在开发时会将其嵌入到项目中。准备好与其他用户共享某个包并在其他项目中进行测试时,可以将其发布到某一范围内的包注册表。
您可以按照创建自定义包的说明,通过在 Packages
文件夹下的文件夹内创建包内容来嵌入一个新的包。还可以通过 Package Manager 脚本 API 嵌入现有的包。有关更多信息,请参阅在项目中嵌入包。
嵌入式包不会在项目清单中显示为依赖项;但是,如果使用 Client.Embed 方法嵌入了某个版本的已安装包,则项目清单仍会列出对原始已安装版本的依赖关系。在这种情况下,磁盘上的包优先于列出为依赖项的包版本。例如,如果项目清单指定了对包 X 版本 1.3.1 的依赖关系,但是项目还具有该名称的嵌入式包,则 Package Manager 将使用嵌入式包(无论是否是其明显版本),而不是从注册表下载更高的版本。
您有责任跟踪嵌入式包的内容以及对其所做的任何更改。如果您的 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.