list | 将传递给签出命令的资源的列表。可以在回调中对此列表移除或添加资源。 |
changesetID | 将此设置为现有变更集的 ID,以提交该变更集中列出的资源。如果找不到与指定 ID 匹配的变更集,则会阻止提交并引发错误消息。 |
changesetDescription | 如果要提交新变更集中的资源,请设置此描述字符串,会创建新变更集并在其中提交资源。 |
在版本控制提交之前要调用的用户提供的回调的委托。
可以设置 PreSubmitCallback 以启用以下内容:
通过从回调返回 true 来允许提交。
通过从回调返回 false 来阻止提交。
修改要提交的资源的列表(可能希望阻止提交特定资源,或确保提交特定资源)。
将提交重定向到现有变更集。
创建新变更集以提交其中的资源。
注意:
AssetList 是绝对的 - 资源和/或其元文件在此回调返回之后不会自动添加,不过在它们未处于正确状态进行提交时可以过滤掉。
不得在此回调内调用会导致创建进一步提交操作的任何代码,因为这会导致可能无限的递归。
同时设置 changesetID 和 changesetDescription 会导致在提交过程中更改现有变更集的变更集描述。
请注意域重新加载。如果在任何时候都可能重新加载程序集,则需要使用所选回调再次设置 Provider.preSubmitCallback。
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.