Using variables in animation

I have an animation which makes my game objects shrink. I want all my game objects’ shrinkage amount to depend on their distances from the center of my map. How can I link my keyframes to specific variables in my script? Thanks

if you put your animation in an animator, set the animation speed to 0, you can use animator.Play to jump to given time