Containers of Script Objects

I am currently working on an abstract container class in C# that I want to be able to hold scripts (similar to here), but I want the holder to know what the list is holding so that it can call the functions as needed. additionally I want the script being added to the list to be like an individual script on the object instead of an instance of the original script in question so that inspector modifications can be made to it. would this already happen, or do I need to change approaches?

does it make any difference that I am essentially making an abstract base class to hold abstract base classes. technically these containers will be held by a controller, and such (references at least), but I don’t think that will cause any issues.

EDIT: to more clarify the question. I want to be able to add scripts to the entity’s serialized list(s) (in the inspector), but still be able to treat them like scripts on the object (being able to modify values based on the given entity), or would it be better to simply place them as script components, and adding them to the list(s) through transform.parent.GetComponent instead?

It sounds like you’re describing metaclasses, which to my knowledge are only available in very dynamic scripting languages. It sounds like you need to create quite a broad base class to handle many cases, even if the majority of the cases aren’t used in any one script. This avoids the ugly situation of attempting a cast to a child class and checking for null. Some metaclass-like functionality may be achieved with the use of static functions and keeping a static list of class instances.

Since your array of scripts is defined as the base class type I don’t think unity will be able to expose public members of child classes to the UI. You could shift all your variables to the base class but adding the scripts directly as components, as you mentioned, might be better. Then you could search for all derived classes in an initialization script and construct your list at runtime.