SpriteStudioForUnity.SpriteStudioBaker.SetBoolCurve C# (CSharp) 메소드

SetBoolCurve() 공개 메소드

public SetBoolCurve ( AnimationCurve curve, SpriteStudioAnimePackAnimePartAnimeAttribute attribute, float fps ) : void
curve UnityEngine.AnimationCurve
attribute SpriteStudioAnimePackAnimePartAnimeAttribute
fps float
리턴 void
        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;
            }
        }