Visibility attributes (ShowIf, HideIf, etc.) are ignored by RequiredAttribute (and other validation features).

Issue #566 resolved
nick martel created an issue
[SerializeField, ShowIf("_foo"), Required] private ScriptableObject _requiredNoMatterWhat; // Validation will still apply to this field.
private bool _foo = false;

Comments (4)

  1. maxstriebel

    Is there any news about this? I have a setup where I hide structs when it is not needed, but I still want to have a value be [Required] when the struct it is not hidden. For normal use this is not a problem since the error is hidden, but the scenen validator still reports it.

  2. Tor Esa Vestergaard
    • changed status to open

    This is now considered a feature targeted for Odin 3.0. Expect it and many other useful things to be there!

  3. Log in to comment