Add components to a list in inspector and then activate them at runtime?

So I am creating a game which has a build mode where you can place various objects. Some of the prefabs I am instantiating from have scripts that I do not wish to be active during placement, only after placement has been completed. I thought a good solution was to disable these script components by default, and then call a method which activates them upon successful placement.

Perhaps this is not the best approach, and I’m open to alternative suggestions. All input is greatly appreciated.

151383-question-grab.png

Here’s my inspector. As you can see I have two scripts which I would like to activate later, both of which have been placed in a list already.

[SerializeField]
List<Component> activateOnBuild = new List<Component>();

    private void ActivateComponents()
    {
        foreach (Component comp in activateOnBuild)
        {
            comp.enabled = true;
        }
    }

And here’s my current code. Obviously “comp.enabled = true” doesn’t work but it displays what I’m trying to achieve.

Replace Component by Behaviour. The enabled property is defined here (and in some other components such as Collider if I remember correctly, but they don’t inherit from Behaviour)