-
Notifications
You must be signed in to change notification settings - Fork 83
Open
Description
Copied from microsoft/vscode-dotnettools#2827 cc @BarionLP
Describe the feature you'd like
i have this pattern where i expose a field in the editor and use the Reset method to populate it with a default reference, e.g. like this:
[SerializeField] private MyComponent component;
void Reset()
{
component = GetComponent<MyComponent>();
}this way i have the option to use a different one without having to assign the field every time
unfortunately this will trigger UNT0039 telling me to use RequireComponentAttribute.
It would be nice to disable that rule in this case
Alternatives considered
people probably do other things with GetComponent in Reset so the rule could only be disabled when no members of the result are used
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels