dbrizov / NaughtyAttributes

Attribute Extensions for Unity
MIT License
4.53k stars 464 forks source link

[Request] Suppress ExpandableAttribute warning #305

Open rhys-vdw opened 2 years ago

rhys-vdw commented 2 years ago

I use the following pattern:

  public abstract class ProbabilityConfig<T> : ScriptableObject where T : Object {
    [System.Serializable]
    public struct Entry {
      [Expandable]
      public T Value;
      public int Weight;
    }

    [SerializeField] Entry[] _entries;

Sometimes the inheriting class uses SOs, sometimes it uses other types. In the case where I'm using non-SO types I get a lot of noise in the inspector:

image

I would like to open a PR that adds an option to suppress this warning, e.g.:

[Expandable(WarnOnIncompatible = false)]