How do I allow Unity attributes to be on their own line?
Completed
I am using Rider in a Unity project that has a bit of history (and some lost tribal knowledge). Right now I try to write this code:
[SerializeField]
private float number = 2.0f;
But Rider always autocorrects to this:
[SerializeField] private float number = 2.0f;
How can I disable this autocorrection for everyone working on my project? I want to allow either form as valid.
Please sign in to leave a comment.
Hello! You can change this here: `File | Settings | Editor | Code Style | C# | Line Breaks and Wrapping` > `Arrangement of Attributes` section > `Place field attribute on the same line > Never`.
Hi!
And how would you add a blank line between the [Header()] tag and [SerializeField] ?
The correct form being :
Hello!
At the moment there is no such rule, but we have this feature request on our tracker. We would appreciate it if you could upvote the issue to demonstrate additional interest.
Thanks! You have my upvote!