How to saving and loading animation curves

Is there any way to save an animation curve by playerprefs ? The animation curves in the inspector reset each time the script is changed (public variables added) I want record my animation In runtime as animation curve then I load It next time(same playerprefs I want save/load it)
using UnityEngine;
using System.Collections;

public class curvRecord : MonoBehaviour {
    public AnimationCurve xPositionCurve;
    public float timer = 0;
    public float recorder = 0;
    public bool play;
    public bool Reset;
    public bool record;

    void Update () {
        if (Reset && !play && ! record) {
            xPositionCurve.RemoveKey (5);
            play = false;
            recorder = 0;
            timer = 0;
        if(play && timer<=recorder){
            record = false;  Reset = false;
            Vector3 localPosition = transform.position;
            localPosition.x = xPositionCurve.Evaluate (timer);
            transform.localPosition = localPosition;

            // Increase the timer by the time since last frame
            timer += Time.deltaTime;

        } else if(!play && record) {
            Reset = false;
            recorder += Time.deltaTime;
            xPositionCurve.AddKey (recorder, gameObject.transform.position.x);

I can record and play my curve animation but when I go exit from game reset curve animation.when I start game again I want load last curve animation

You can see my problem in this video: videoLink

Hi @smkplus3d. followong to that tutorial:
you need to save&load it, without it they are just avalaible in inspector and in gameplay you made them. You may use then an Dictionary to store which frame and it’s variables and just save them and load.