JetBrains / JetBrains/resharper-unity

QuickFix to generate OnValidate IsNotNull on SerializeField

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

Description

```
public class NewBehaviourScript : MonoBehaviour
{
[SerializeField] private GameObject MyField;

// QuickFix to generate this on MyField
void OnValidate()
{
Assert.IsNotNull(MyField);
}
}
```

Contributor guide

Open the contributing guide

Research direction

Start by locating the existing QuickFix entry points for Unity and serialized fields, then review how generated methods and assertions are tested. Done means a QuickFix can generate the shown OnValidate method with an Assert.IsNotNull check for a selected SerializeField.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.