Example #1
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);
                 }
             }
         }
     }
 }
Example #2
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);
                                }
                            }
                        }
                    }
                }
            }
        }
Example #3
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);
                 }
             }
         }
     }
 }
Example #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
        }
Example #5
0
        public void AddClipCurveData(Component component, string name, bool isProperty, Type type)
        {
            MemberClipCurveData data = new MemberClipCurveData();

            data.Type         = component.GetType().Name;
            data.PropertyName = name;
            data.IsProperty   = isProperty;
            data.PropertyType = UnityPropertyTypeInfo.GetMappedType(type);
            initializeClipCurves(data, component);
            curveData.Add(data);
        }
Example #6
0
        public void AddClipCurveData(Component component, string name, bool isProperty, Type type)
        {
#if PROFILE_FILE
            Profiler.BeginSample("CinemaClipCurve.AddClipCurveData");
#endif // PROFILE_FILE
            MemberClipCurveData data = new MemberClipCurveData();
            data.Type         = component.GetType().Name;
            data.PropertyName = name;
            data.IsProperty   = isProperty;
            data.PropertyType = UnityPropertyTypeInfo.GetMappedType(type);
            initializeClipCurves(data, component);
            curveData.Add(data);
#if PROFILE_FILE
            Profiler.EndSample();
#endif // PROFILE_FILE
        }
Example #7
0
        public void AddClipCurveData(Component component, string name, bool isProperty, Type type)
        {
            MemberClipCurveData data = new MemberClipCurveData();

            data.Type         = component.GetType().Name;
            data.PropertyName = name;
            data.IsProperty   = isProperty;
            data.PropertyType = UnityPropertyTypeInfo.GetMappedType(type);
            if (initializeClipCurves(data, component))
            {
                curveData.Add(data);
            }
            else
            {
                Debug.LogError("Could not initialize curve clip, invalid initial values.");
            }
        }
Example #8
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
        }
Example #9
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);
                        }
                    }
                }
            }
        }
Example #10
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);
                        }
                    }
                }
            }
        }
Example #11
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);
                         }
                     }
                 }
             }
         }
     }
 }