Example #1
0
        public void GoToPreviousKeyframe(PropertyModification[] modifications)
        {
            EditorCurveBinding[] bindings = AnimationWindowUtility.PropertyModificationsToEditorCurveBindings(modifications, state.activeRootGameObject, state.activeAnimationClip);
            if (bindings.Length == 0)
            {
                return;
            }

            List <AnimationWindowCurve> curves = new List <AnimationWindowCurve>();

            for (int i = 0; i < state.allCurves.Count; ++i)
            {
                AnimationWindowCurve curve = state.allCurves[i];
                if (Array.Exists(bindings, binding => curve.binding.Equals(binding)))
                {
                    curves.Add(curve);
                }
            }

            float newTime = AnimationWindowUtility.GetPreviousKeyframeTime(curves.ToArray(), time.time, state.clipFrameRate);

            SetCurrentTime(state.SnapToFrame(newTime, AnimationWindowState.SnapMode.SnapToClipFrame));

            state.Repaint();
        }
        public override void GoToPreviousKeyframe()
        {
            List <AnimationWindowCurve> list = (!this.state.showCurveEditor || this.state.activeCurves.Count <= 0) ? this.state.allCurves : this.state.activeCurves;
            float previousKeyframeTime       = AnimationWindowUtility.GetPreviousKeyframeTime(list.ToArray(), this.time.time, this.state.clipFrameRate);

            this.SetCurrentTime(this.state.SnapToFrame(previousKeyframeTime, AnimationWindowState.SnapMode.SnapToClipFrame));
        }
Example #3
0
        public override void GoToPreviousKeyframe()
        {
            List <AnimationWindowCurve> curves = (state.showCurveEditor && state.activeCurves.Count > 0) ? state.activeCurves : state.allCurves;

            float newTime = AnimationWindowUtility.GetPreviousKeyframeTime(curves.ToArray(), time.time, state.clipFrameRate);

            SetCurrentTime(state.SnapToFrame(newTime, AnimationWindowState.SnapMode.SnapToClipFrame));
        }
 public void GoToPreviousKeyframe(PropertyModification[] modifications)
 {
     EditorCurveBinding[] array = AnimationWindowUtility.PropertyModificationsToEditorCurveBindings(modifications, this.state.activeRootGameObject, this.state.activeAnimationClip);
     if (array.Length != 0)
     {
         List <AnimationWindowCurve> list = new List <AnimationWindowCurve>();
         for (int i = 0; i < this.state.allCurves.Count; i++)
         {
             AnimationWindowCurve curve = this.state.allCurves[i];
             if (Array.Exists <EditorCurveBinding>(array, (EditorCurveBinding binding) => curve.binding.Equals(binding)))
             {
                 list.Add(curve);
             }
         }
         float previousKeyframeTime = AnimationWindowUtility.GetPreviousKeyframeTime(list.ToArray(), this.time.time, this.state.clipFrameRate);
         this.SetCurrentTime(this.state.SnapToFrame(previousKeyframeTime, AnimationWindowState.SnapMode.SnapToClipFrame));
         this.state.Repaint();
     }
 }