You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Beside being a lame design decision to have attributes in Unity itself, R# does not process them as usual.
Example:
public sealed class ColorComponentProperties
{
public SerializedProperty Name { get; }
public SerializedProperty Minimum { get; }
public SerializedProperty Maximum { get; }
public SerializedProperty Value { get; }
public ColorComponentProperties(
[NotNull] SerializedProperty name,
[NotNull] SerializedProperty minimum,
[NotNull] SerializedProperty maximum,
[NotNull] SerializedProperty value)
{
if (name == null)
throw new ArgumentNullException(nameof(name));
if (minimum == null)
throw new ArgumentNullException(nameof(minimum));
if (maximum == null)
throw new ArgumentNullException(nameof(maximum));
if (value == null)
throw new ArgumentNullException(nameof(value));
Name = name;
Minimum = minimum;
Maximum = maximum;
Value = value;
}
}
If you add [PublicApi] to the class itself, R# normally will stop bugging you for all public properties; this happens when you use the NuGet package as well as manually adding annotations to a project.
In Unity projects however, R# does not react the same, it still sees those public properties as 'could be made private'.
Note that this happens with default settings on Options/Code annotations.
Thanks !
The text was updated successfully, but these errors were encountered:
This is because the attributes that Unity has included in UnityEngine.dll are an old version. Specifically, the [PublicAPI] attribute is marked with [MeansImplicitUse], whereas it should be marked with [MeansImplicitUse(ImplicitUseTargetFlags.WithMembers)].
Beside being a lame design decision to have attributes in Unity itself, R# does not process them as usual.
Example:
If you add
[PublicApi]
to the class itself, R# normally will stop bugging you for all public properties; this happens when you use the NuGet package as well as manually adding annotations to a project.In Unity projects however, R# does not react the same, it still sees those public properties as 'could be made private'.
Note that this happens with default settings on Options/Code annotations.
Thanks !
The text was updated successfully, but these errors were encountered: