如何专门在数组类型的骑手中创建代码模板(对于后缀字符)?
我想具有编写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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,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).