The conditional attributes like ShowIf / HideIf do not work when the sourceHandle parameter is a private field of a serializable classes that is a base class of the serialized object. Changing the sourceHandle access modifier from private to public fixes the problem.
For example, this does not work:
[Serializable]
public class BaseClass
{
[SerializeField] private bool visible;
[SerializeField, ShowIf(nameof(visible), true)] private int property;
}
[Serializable]
public class ChildClass : BaseClass
{
// More fields...
}
It shows the following error (edited for clarity):
[Editor Toolbox] ShowIfAttribute: (property) property in (object): Member (visible) not found.
It only works after changing the field access modifier from private to protected:
[SerializeField] protected bool visible;