JetBrains / JetBrains/resharper-unity

All public fields are considered Unity serialisable

Open
#1,304 3 comments 3 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
1.2k
Forks
142
PR merge metrics
No merged PRs in 30d

Description

![rider64_2019-08-27_10-49-15](https://user-images.githubusercontent.com/17784523/63761526-38dca500-c8b9-11e9-9bf7-7b1cc1ac0faf.png)

Any public field in a MonoBehaviour is subject to Unity Engine Language & Frameworks Serialized field naming rules rather than C# Code Style "Fields (not private)" regardless of whether Unity can serialize it. Fields that do not represent a type Unity can serialize should use the C# Code Style rules.

For our particular usecase we mark all private fields (including those tagged with SerializeField) as m_, but public fields should be PascalCased.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the behavior for public fields in a MonoBehaviour, comparing fields whose types Unity can serialize with fields it cannot. Trace how Unity serialization rules and the C# Code Style "Fields (not private)" setting are selected. Done means serializable fields retain Unity naming rules while non-serializable public fields use PascalCase.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, unity
Domain
game-dev, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.