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?
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).