internal void TranslateCurves(float amount) { Firetime += amount; CinemaMemberCurveWrapper[] memberCurves = MemberCurves; for (int i = 0; i < memberCurves.Length; i++) { CinemaAnimationCurveWrapper[] animationCurves = memberCurves[i].AnimationCurves; for (int j = 0; j < animationCurves.Length; j++) { CinemaAnimationCurveWrapper cinemaAnimationCurveWrapper = animationCurves[j]; if (amount > 0f) { for (int k = cinemaAnimationCurveWrapper.KeyframeCount - 1; k >= 0; k--) { Keyframe keyframe = cinemaAnimationCurveWrapper.GetKeyframe(k); Keyframe kf = new Keyframe(keyframe.time + amount, keyframe.value, keyframe.inTangent, keyframe.outTangent); cinemaAnimationCurveWrapper.MoveKey(k, kf); } } else { for (int l = 0; l < cinemaAnimationCurveWrapper.KeyframeCount; l++) { Keyframe keyframe2 = cinemaAnimationCurveWrapper.GetKeyframe(l); Keyframe kf2 = new Keyframe(keyframe2.time + amount, keyframe2.value, keyframe2.inTangent, keyframe2.outTangent); cinemaAnimationCurveWrapper.MoveKey(l, kf2); } } } } }
private void updateKeyframeTime(float oldTime, float newTime) { CinemaMemberCurveWrapper[] memberCurves = MemberCurves; for (int i = 0; i < memberCurves.Length; i++) { CinemaAnimationCurveWrapper[] animationCurves = memberCurves[i].AnimationCurves; for (int j = 0; j < animationCurves.Length; j++) { CinemaAnimationCurveWrapper cinemaAnimationCurveWrapper = animationCurves[j]; for (int k = 0; k < cinemaAnimationCurveWrapper.KeyframeCount; k++) { Keyframe keyframe = cinemaAnimationCurveWrapper.GetKeyframe(k); if (Mathf.Abs(keyframe.time - oldTime) < 1E-05) { Keyframe kf = new Keyframe(newTime, keyframe.value, keyframe.inTangent, keyframe.outTangent); cinemaAnimationCurveWrapper.MoveKey(k, kf); } } } } }