How to write a generic Mecanim Animation System in an EntityComponentSystem Architecture

I am currently creating a game which shall use Mecanim to animate characters and enemies.
For this i want to use Mecanim and was successfull in my first attempts.
But these included to write a script for each single animation i made because of the string references to parameters and layers within the mecanim statemachines.
Since i am using the Entity-Component-System architecture to structure my code i would prefer to have one single System which handles all animations in the game.

Unfortunately i have no clue how to bring the versatility mecanim provides with its parameters, transitions and other statemachine stuff into one single system, which then knows how to behave properly for each mecanim animation i provide.
What needs such a System to know?
Is there code from someone who did it before?
Is it even possible to write something like this?

Not up to speed with ECS but looking online it appears Unity is a partial ECS system itself.

I think it would be possible to put all animations in one Mecanim animator but unless every character behaves in a very similar way it will be messy.

You could set a bool for say isPlayer or isSkeleton or isZombie and have one script do it all but would you want your skeleton to walk the same as your zombie? If not then the animator would be horrific and not just because of the zombies and skeletons!

Really you’d be better having a prefab of each distinct enemy/player/NCP and build a script and animator for each.

I’m only playing with Unity for a hobby but for example I’ve got a player animator that has different layers for walk/run/idle, cast spell, blade weapon, bow weapon, blunt weapon and swimming. Not to mention any character interactions that I haven’t done yet.

Then I’ve got an NPC that goes mining, if it mines enough it smelts into an ore bar, it goes to sleep at a set time and gets up at a set time as well as attacking. If I tried to add all this together within mecanim with my player setup it would be really messy but if I want another miner then I just instantiate another miner prefab.

I’m aiming for an Oblivion style of NPC’s and Enemies having jobs and activities that are unique them so one animator/script of me would be harder to achieve than separate ones, however…

If all enemies are going to use the same motions then yep one script and one animator would be completely acceptable.