0

I am developing games in Unity with Rider IDE and I need to adopt a code style for my C# code. I feel that the default settings is not aligning well with Unity. I can change the naming convention somewhat but I feel it's too much configuration to maintain and it's more opinionated towards me.

I just want to copy someone's Rider code style settings so that I can focus on my work instead of focusing on naming conventions, blank lines, braces, etc.

Please suggest me some code style to adopt that I can configure in Rider.

off99555
  • 3,797
  • 3
  • 37
  • 49
  • I'm curious how it's not aligning with unity. – pale bone Oct 20 '18 at 06:07
  • For example, the default settings use upper case for some variables that unity use lower case. There are many small details difference like this. I want something like `standard JS` that you just apply a code style without the need to configure. – off99555 Oct 20 '18 at 06:32

1 Answers1

2

Unity plugin for Rider 2018.3 will inject Unity-layer (with code-style) to settings, so you will able to use Rider without any changes in settings to develop Unity projects. Morethan, Rider 2018.3 will autodetect your naming rules for C# (not all code-style), so if you start develop with Microsoft code-style, injected layer will not affect you.

Btw, Microsoft code-style is better and new versions of Unity (like ECS) prefers this way.

And here you can find .dotsettings file for Unity style: https://github.com/JetBrains/resharper-unity/blob/d1c83886aab4d56d7ff4cf22c7916fc869bcf497/resharper/resharper-unity/src/Unity.DotSettings

In settings, click Manage layers button, then select solution personal layer and use right click, then choose Add layer.