Exemplo n.º 1
0
 private void DeleteKeysAtCurrentTime(List <AnimationWindowCurve> curves)
 {
     using (List <AnimationWindowCurve> .Enumerator enumerator = curves.GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             AnimationWindowCurve current = enumerator.Current;
             current.RemoveKeyframe(this.state.time);
             this.state.SaveCurve(current);
         }
     }
 }
        public static void RemoveKeyframes(AnimationWindowState state, AnimationWindowCurve[] curves, AnimationKeyTime time)
        {
            string undoLabel = "Remove Key";

            state.SaveKeySelection(undoLabel);
            for (int i = 0; i < curves.Length; i++)
            {
                AnimationWindowCurve animationWindowCurve = curves[i];
                if (animationWindowCurve.animationIsEditable)
                {
                    AnimationKeyTime time2 = AnimationKeyTime.Time(time.time - animationWindowCurve.timeOffset, time.frameRate);
                    animationWindowCurve.RemoveKeyframe(time2);
                    state.SaveCurve(animationWindowCurve, undoLabel);
                }
            }
        }