MyBox icon indicating copy to clipboard operation
MyBox copied to clipboard

Foldout doesn't work properly in child classes

Open SegFaultGitHub opened this issue 1 year ago • 0 comments

It seems like the access modifiers sometimes prevent the field to be added in the foldouts for child classes. Example:

public class Parent : MonoBehaviour {
    #region Serialized fields
    [field: Foldout("Parent", true)]
    [field: SerializeField] protected bool AAA;
    [field: SerializeField] protected bool BBB;
    [field: SerializeField] public bool DDD { get; private set; }
    [field: SerializeField] public bool EEE { get; protected set; }
    [field: SerializeField] public bool FFF { protected get; set; }
    [field: SerializeField] public bool GGG;
    [field: SerializeField] private protected bool HHH;
    #endregion
}

public class Child : Parent {
    #region Serialized fields
    [field: Foldout("Child", true)]
    [field: SerializeField] private bool CCC;
    #endregion
}

image

SegFaultGitHub avatar Apr 11 '24 11:04 SegFaultGitHub