Esempio n. 1
0
 public void TranslateCurves(float amount)
 {
     Firetime += amount;
     foreach (MemberClipCurveData data in curveData)
     {
         int curveCount = UnityPropertyTypeInfo.GetCurveCount(data.PropertyType);
         for (int i = 0; i < curveCount; i++)
         {
             AnimationCurve animationCurve = data.GetCurve(i);
             if (amount > 0)
             {
                 for (int j = animationCurve.length - 1; j >= 0; j--)
                 {
                     Keyframe kf          = animationCurve.keys[j];
                     Keyframe newKeyframe = new Keyframe(kf.time + amount, kf.value, kf.inTangent, kf.outTangent);
                     newKeyframe.tangentMode = kf.tangentMode;
                     AnimationCurveHelper.MoveKey(animationCurve, j, newKeyframe);
                 }
             }
             else
             {
                 for (int j = 0; j < animationCurve.length; j++)
                 {
                     Keyframe kf          = animationCurve.keys[j];
                     Keyframe newKeyframe = new Keyframe(kf.time + amount, kf.value, kf.inTangent, kf.outTangent);
                     newKeyframe.tangentMode = kf.tangentMode;
                     AnimationCurveHelper.MoveKey(animationCurve, j, newKeyframe);
                 }
             }
         }
     }
 }
Esempio n. 2
0
 public void TranslateCurves(float amount)
 {
     base.Firetime += amount;
     for (int i = 0; i < curveData.Count; i++)
     {
         int curveCount = UnityPropertyTypeInfo.GetCurveCount(curveData[i].PropertyType);
         for (int j = 0; j < curveCount; j++)
         {
             AnimationCurve animationCurve = curveData[i].GetCurve(j);
             if (amount > 0)
             {
                 for (int k = animationCurve.length - 1; k >= 0; k--)
                 {
                     Keyframe kf          = animationCurve.keys[k];
                     Keyframe newKeyframe = new Keyframe(kf.time + amount, kf.value, kf.inTangent, kf.outTangent);
                     newKeyframe.tangentMode = kf.tangentMode;
                     AnimationCurveHelper.MoveKey(animationCurve, k, newKeyframe);
                 }
             }
             else
             {
                 for (int k = 0; k < animationCurve.length; k++)
                 {
                     Keyframe kf          = animationCurve.keys[k];
                     Keyframe newKeyframe = new Keyframe(kf.time + amount, kf.value, kf.inTangent, kf.outTangent);
                     newKeyframe.tangentMode = kf.tangentMode;
                     AnimationCurveHelper.MoveKey(animationCurve, k, newKeyframe);
                 }
             }
         }
     }
 }
Esempio n. 3
0
        private void updateKeyframeTime(float oldTime, float newTime)
        {
            {
                var __list1      = curveData;
                var __listCount1 = __list1.Count;
                for (int __i1 = 0; __i1 < __listCount1; ++__i1)
                {
                    var data = (MemberClipCurveData)__list1[__i1];
                    {
                        int curveCount = UnityPropertyTypeInfo.GetCurveCount(data.PropertyType);
                        for (int i = 0; i < curveCount; i++)
                        {
                            AnimationCurve animationCurve = data.GetCurve(i);
                            for (int j = 0; j < animationCurve.length; j++)
                            {
                                Keyframe kf = animationCurve.keys[j];

                                if (Mathf.Abs(kf.time - oldTime) < 0.00001)
                                {
                                    Keyframe newKeyframe = new Keyframe(newTime, kf.value, kf.inTangent, kf.outTangent);
                                    newKeyframe.tangentMode = kf.tangentMode;
                                    AnimationCurveHelper.MoveKey(animationCurve, j, newKeyframe);
                                }
                            }
                        }
                    }
                }
            }
        }
Esempio n. 4
0
        private void updateKeyframeTime(float oldTime, float newTime)
        {
#if PROFILE_FILE
            Profiler.BeginSample("CinemaClipCurve.updateKeyframeTime");
#endif // PROFILE_FILE
            var list  = curveData;
            var count = list.Count;
            for (var x = 0; x < count; x++)
            {
                var data       = list[x];
                int curveCount = UnityPropertyTypeInfo.GetCurveCount(data.PropertyType);
                for (int i = 0; i < curveCount; i++)
                {
                    AnimationCurve animationCurve = data.GetCurve(i);
                    var            length         = animationCurve.length;
                    for (int j = 0; j < length; j++)
                    {
                        Keyframe kf = animationCurve.keys[j];

                        if (Mathf.Abs(kf.time - oldTime) < 0.00001)
                        {
                            Keyframe newKeyframe = new Keyframe(newTime, kf.value, kf.inTangent, kf.outTangent);
                            newKeyframe.tangentMode = kf.tangentMode;
                            AnimationCurveHelper.MoveKey(animationCurve, j, newKeyframe);
                        }
                    }
                }
            }
#if PROFILE_FILE
            Profiler.EndSample();
#endif // PROFILE_FILE
        }
Esempio n. 5
0
        public void TranslateCurves(float amount)
        {
#if PROFILE_FILE
            Profiler.BeginSample("CinemaClipCurve.TranslateCurves");
#endif // PROFILE_FILE
            base.Firetime += amount;
            var list  = curveData;
            var count = list.Count;
            for (var x = 0; x < count; x++)
            {
                var data       = list[x];
                int curveCount = UnityPropertyTypeInfo.GetCurveCount(data.PropertyType);
                for (int i = 0; i < curveCount; i++)
                {
                    AnimationCurve animationCurve = data.GetCurve(i);
                    if (amount > 0)
                    {
                        for (int j = animationCurve.length - 1; j >= 0; j--)
                        {
                            Keyframe kf          = animationCurve.keys[j];
                            Keyframe newKeyframe = new Keyframe(kf.time + amount, kf.value, kf.inTangent, kf.outTangent);
                            newKeyframe.tangentMode = kf.tangentMode;
                            AnimationCurveHelper.MoveKey(animationCurve, j, newKeyframe);
                        }
                    }
                    else
                    {
                        var length = animationCurve.length;
                        for (int j = 0; j < length; j++)
                        {
                            Keyframe kf          = animationCurve.keys[j];
                            Keyframe newKeyframe = new Keyframe(kf.time + amount, kf.value, kf.inTangent, kf.outTangent);
                            newKeyframe.tangentMode = kf.tangentMode;
                            AnimationCurveHelper.MoveKey(animationCurve, j, newKeyframe);
                        }
                    }
                }
            }
#if PROFILE_FILE
            Profiler.EndSample();
#endif // PROFILE_FILE
        }
Esempio n. 6
0
        private void updateKeyframeTime(float oldTime, float newTime)
        {
            foreach (MemberClipCurveData data in curveData)
            {
                int curveCount = UnityPropertyTypeInfo.GetCurveCount(data.PropertyType);
                for (int i = 0; i < curveCount; i++)
                {
                    AnimationCurve animationCurve = data.GetCurve(i);
                    for (int j = 0; j < animationCurve.length; j++)
                    {
                        Keyframe kf = animationCurve.keys[j];

                        if (Mathf.Abs(kf.time - oldTime) < 0.00001)
                        {
                            Keyframe newKeyframe = new Keyframe(newTime, kf.value, kf.inTangent, kf.outTangent);
                            AnimationCurveHelper.MoveKey(animationCurve, j, newKeyframe);
                        }
                    }
                }
            }
        }
Esempio n. 7
0
        private void updateKeyframeTime(float oldTime, float newTime)
        {
            for (int i = 0; i < curveData.Count; i++)
            {
                int curveCount = UnityPropertyTypeInfo.GetCurveCount(curveData[i].PropertyType);
                for (int j = 0; j < curveCount; j++)
                {
                    AnimationCurve animationCurve = curveData[i].GetCurve(j);
                    for (int k = 0; k < animationCurve.length; k++)
                    {
                        Keyframe kf = animationCurve.keys[k];

                        if (Mathf.Abs(kf.time - oldTime) < 0.00001)
                        {
                            Keyframe newKeyframe = new Keyframe(newTime, kf.value, kf.inTangent, kf.outTangent);
                            newKeyframe.tangentMode = kf.tangentMode;
                            AnimationCurveHelper.MoveKey(animationCurve, k, newKeyframe);
                        }
                    }
                }
            }
        }
Esempio n. 8
0
 public void TranslateCurves(float amount)
 {
     base.Firetime += amount;
     {
         var __list2      = curveData;
         var __listCount2 = __list2.Count;
         for (int __i2 = 0; __i2 < __listCount2; ++__i2)
         {
             var data = (MemberClipCurveData)__list2[__i2];
             {
                 int curveCount = UnityPropertyTypeInfo.GetCurveCount(data.PropertyType);
                 for (int i = 0; i < curveCount; i++)
                 {
                     AnimationCurve animationCurve = data.GetCurve(i);
                     if (amount > 0)
                     {
                         for (int j = animationCurve.length - 1; j >= 0; j--)
                         {
                             Keyframe kf          = animationCurve.keys[j];
                             Keyframe newKeyframe = new Keyframe(kf.time + amount, kf.value, kf.inTangent, kf.outTangent);
                             newKeyframe.tangentMode = kf.tangentMode;
                             AnimationCurveHelper.MoveKey(animationCurve, j, newKeyframe);
                         }
                     }
                     else
                     {
                         for (int j = 0; j < animationCurve.length; j++)
                         {
                             Keyframe kf          = animationCurve.keys[j];
                             Keyframe newKeyframe = new Keyframe(kf.time + amount, kf.value, kf.inTangent, kf.outTangent);
                             newKeyframe.tangentMode = kf.tangentMode;
                             AnimationCurveHelper.MoveKey(animationCurve, j, newKeyframe);
                         }
                     }
                 }
             }
         }
     }
 }