void SetFloatCurve(AnimationCurve curve, SpriteStudioAnimePackAnimePartAnimeAttribute attribute, float fps, int frameCount, float unit = 1.0f, float baseValue = 0)
        {
            List<float> keyList = new List<float> (frameCount);
            SpriteStudioAnimePackAnimePartAnimeAttributeKey prevKey = null;
            SpriteStudioAnimePackAnimePartAnimeAttributeKey nextKey = null;

            for (int i = 0; i < frameCount; i++) {
                float value = 0;
                SpriteStudioAnimePackAnimePartAnimeAttributeKey key = attribute.key.FirstOrDefault (v => v.time == i);

                if (key != null) {
                    value = GetValue (key);
                    prevKey = key;
                } else {
                    IEnumerable<SpriteStudioAnimePackAnimePartAnimeAttributeKey> keys = attribute.key.Where (v => v.time > i);
                    if (keys.Count () == 0) {
                        break;
                    }

                    if (prevKey == null) {
                        prevKey = keys.First ();
                        value = GetValue (prevKey);
                    } else {
                        nextKey = keys.First ();

                        float valuePrev = GetValue (prevKey);
                        float valueNext = GetValue (nextKey);
                        int timePrev = prevKey.time;
                        int timeNext = nextKey.time;
                        float timeNormalize = (float)(i - timePrev) / (float)(timeNext - timePrev);
                        timeNormalize = Mathf.Clamp01 (timeNormalize);

                        switch (prevKey.ipType) {
                        case "linear":
                            {
                                value = GetLinear (valuePrev, valueNext, timeNormalize);
                                break;
                            }
                        case "bezier":
                            {
                                float curveStartTime = float.Parse (prevKey.curve.Value.Split (' ') [0]);
                                float curveStartValue = float.Parse (prevKey.curve.Value.Split (' ') [1]);
                                float curveEndTime = float.Parse (prevKey.curve.Value.Split (' ') [2]);
                                float curveEndValue = float.Parse (prevKey.curve.Value.Split (' ') [3]);
                                Vector2 start = new Vector2 ((float)timePrev, valuePrev);
                                Vector2 controlStart = new Vector2 (curveStartTime, curveStartValue);
                                Vector2 end = new Vector2 ((float)timeNext, valueNext);
                                Vector2 controlEnd = new Vector2 (curveEndTime, curveEndValue);
                                value = GetBezier (start, controlStart, end, controlEnd, timeNormalize);
                                break;
                            }
                        case "hermite":
                            {
                                float curveStartValue = float.Parse (prevKey.curve.Value.Split (' ') [1]);
                                float curveEndValue = float.Parse (prevKey.curve.Value.Split (' ') [3]);
                                value = GetHermite (valuePrev, curveStartValue, valueNext, curveEndValue, timeNormalize);
                                break;
                            }
                        case "acceleration":
                            {
                                value = GetAccelerate (valuePrev, valueNext, timeNormalize);
                                break;
                            }
                        case "deceleration":
                            {
                                value = GetDecelerate (valuePrev, valueNext, timeNormalize);
                                break;
                            }
                        default:
                            {
                                value = GetValue (prevKey);
                                break;
                            }
                        }
                    }

                }
                keyList.Add (value);
            }

            for (int i = 0; i < keyList.Count; i++) {
                float time = GetTime (i, fps);
                float value = keyList [i];

                if (i == 0) {
                    curve.AddKey (KeyframeUtil.GetNew (time, baseValue + value * unit, tangentMode));
                } else if (i == keyList.Count - 1) {
                    curve.AddKey (KeyframeUtil.GetNew (time,baseValue +  value * unit, tangentMode));
                } else {
                    float prev = keyList [i - 1];
                    float next = keyList [i + 1];

                    if (value == prev && value == next) {
                        continue;
                    }
                    curve.AddKey (KeyframeUtil.GetNew (time, baseValue + value * unit, tangentMode));
                }
            }
            curve.UpdateAllLinearTangents ();
        }
 void SetBoolCurve(AnimationCurve curve, SpriteStudioAnimePackAnimePartAnimeAttribute attribute, float fps)
 {
     float prev = 0;
     for (int i = 0; i < attribute.key.Length; i++) {
         SpriteStudioAnimePackAnimePartAnimeAttributeKey key = attribute.key [i];
         float time = GetTime (key.time, fps);
         float value = GetValue (key);
         if (i == 0) {
             curve.AddKey (KeyframeUtil.GetNew (time, value, TangentMode.Stepped));
         } else if (i == attribute.key.Length - 1) {
             curve.AddKey (KeyframeUtil.GetNew (time, value, TangentMode.Stepped));
         } else {
             if (prev != value) {
                 curve.AddKey (KeyframeUtil.GetNew (time, value, TangentMode.Stepped));
             }
         }
         prev = value;
     }
 }