Arrays of Variable Length in the Inspector

I’m creating a class consisting of an enum and an array. Depending on the value of the enum, the array needs to store a variable amount of information. For example, if the enum was “Zero”, I wouldn’t need the array, if the enum was “One”, the array would have to have a length of 1 etc.

I currently have this done in the constructor, but I now need to make these assignments in the inspector. Is it possible for this dependency to show in the inspector i.e. if I choose enum “Two” in the inspector, the number of fields available to fill in from the array changes to 2?

And if you put your array init code not inside of constructor but inside update method like so:

private void Update()
{
    if (CurrentValOfEnum != PrevValOfEnum)
        YourArray = new Type[(int)EnumValue];
}