How to have same entities with components of entity prefabs not refer to same prefabs

I am building a tower defense game where my towers have a spawning component with an entity prefab to spawn. The authoring script takes a gameobject and “converts” it to an entity prefab in the standard way.

public class SpawnerAuthoring : MonoBehaviour
{
    public GameObject entityToSpawn;
    public float spawnDelay;
    public class SpawnerBaker : Baker<SpawnerAuthoring>
    {
        public override void Bake(SpawnerAuthoring authoring)
        {
            Entity entity = GetEntity(TransformUsageFlags.Dynamic);
            Entity entityToSpawn = GetEntity(authoring.entityToSpawn, TransformUsageFlags.Dynamic);
            AddComponent(entity, new SpawnerComponent
            {
                entityToSpawn = entityToSpawn,
                spawnDelay = authoring.spawnDelay,
                spawnProgress = 0,
                speedMultiplier = 1
            });
        }
    }
}

My issue is that you can upgrade these towers which modify the entity prefabs to be spawned. All duplicate towers refer to the same entity prefab to spawn which is not correct as all upgrades are for that tower only. Is there a way that I can avoid this behaviour by having the prefabs duplicated so each tower refers to a different prefab or some other way? T
I appreciate any suggestions and thanks in advance :slight_smile: .

use ECB for Changing Entity Structure.