Creating AnimationClip Using Custom Values

I would like to create an animation using a custom value from a class I’m animating. The name of my class is CharacterMover and it has a property called moveX. I can add the property through Animation window through Add Property menu but I would like to do it using a script.

I can add properties such as localPosition.x in code but CharacterMove.moveX or others I have tried haven’t worked. What is the correct syntax?

Ok, I found the answer. Was looking from a wrong place. Had to use SetCurve with typeof call and the property name as in code.

clip.SetCurve(pathName, typeof(CharacterMover), moveX, animCurve);