Is it possible to create a script dinamic like animation>size controling the Elements variables?

Hey All,
I wanna create a script attached to a gameObject (children of monobehavier)that is able to create variables dinamically in the inspector, just adjusting another variable, like the “animation” component adjusting the “Size” variable (“Element” variables).
I tried to create a class children of System.Object (some people say that you need to create class children of System.Object and others say that needs to be children of mono behavier to show in the inspector, not true) using for loop inside the class to create a number of variables equivalent to another variable declared first, inside the class. I don’t know too much about class, so I don’t know if is denied to use for loop like this inside it, but my script didn’t compiled. Maybe the “animation component” process use an array variable, I don’t know how can I do this. Any idea ???

Okey, the animation component uses an array, like “var targets : Target;”, and the “size” and “elements” are automatic created by the inspector. Is the use of arrays a good practice?