定义了将外部脚本编辑器集成到 UnityEditor 中的职责。
安装 | 向编辑器提供此实例支持的已知和支持的编辑器列表。 |
初始化 | 当从 PreferenceWindow 中选择 IExternalCodeEditor 时,回调到 IExternalCodeEditor。 |
OnGUI | 当 Unity 填充“首选项/外部工具”以允许代码编辑器生成必要的 GUI 时,Unity 会调用此方法。例如,在创建用于修改发送到代码编辑器的参数的参数字段时。 |
打开项目 | 外部代码编辑器需要处理打开文件的请求。 |
同步所有 | Unity 在初始化期间调用此函数以同步项目。这与 SyncIfNeeded 不同,因为它不会获取更改列表。 |
如有必要,同步 | 当您在 Unity 中更改资源时,此方法会为当前选择的 IExternalCodeEditor 实例解析新的和已更改的资源。 |
TryGetInstallationForPath | Unity 存储所选编辑器的路径。IExternalCodeEditor 的实例可以通过在调用此方法时返回 true 来承担此路径的责任。需要使用路径和应在“外部工具”代码编辑器列表中显示的名称构造输出变量安装。 |
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.