如何专门在数组类型的骑手中创建代码模板(对于后缀字符)?

发布于 2025-01-23 11:51:44 字数 269 浏览 0 评论 0原文

我想具有编写somearray.rnd的能力,并且我希望它生成以下代码:

UnityEngine.Random.Range(0, someArray.length)

我找到了这些Postfix模板,但是我认为没有任何选择可以定义我们自己的选择对于c#,仅用于JavaScript/typescript。 这是否可以在统一的骑手中产生这样的代码?

I want to have an ability to write someArray.rnd and I want it to generate the below code:

UnityEngine.Random.Range(0, someArray.length)

I found these Postfix Templates, but I see no option to define our own for C#, only for Javascript/Typescript.
Is this possible to have code generation like this in Rider for Unity?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

白龙吟 2025-01-30 11:51:44

不,AFAIK您无法从方便的工具中创建后修正模板,例如,例如Visual Studio中的 Template Explorer

您要么开发一个自定义插件(顺便说一句,这不是很困难),要么创建 live模板(请参阅Rider中的 file | settings | editor | eDitor | live模板| c# )。

No, afaik you cannot create Postfix Templates from a handy tool, e. g. like the Template Explorer in Visual Studio.

You either develop a custom plugin (which is not very difficult by the way) or you create a Live Template (see File | Settings | Editor | Live Templates | C# in Rider).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文