Process() public static method

public static Process ( IAnimationRecordingState state, UndoPropertyModification modifications ) : UnityEditor.UndoPropertyModification[]
state IAnimationRecordingState
modifications UnityEditor.UndoPropertyModification
return UnityEditor.UndoPropertyModification[]
        private UndoPropertyModification[] RegisterCandidates(UndoPropertyModification[] modifications)
        {
            bool createNewClip = (m_CandidateClip == null);

            if (createNewClip)
            {
                m_CandidateClip        = new AnimationClip();
                m_CandidateClip.legacy = state.activeAnimationClip.legacy;
                m_CandidateClip.name   = "CandidateClip";

                StartCandidateRecording();
            }

            CandidateRecordingState recordingState = new CandidateRecordingState(state, m_CandidateClip);

            UndoPropertyModification[] discardedModifications = AnimationRecording.Process(recordingState, modifications);

            // No modifications were added to the candidate clip, discard.
            if (createNewClip && discardedModifications.Length == modifications.Length)
            {
                ClearCandidates();
            }

            // Make sure inspector is repainted after adding new candidates to get appropriate feedback.
            InspectorWindow.RepaintAllInspectors();

            return(discardedModifications);
        }
 private UndoPropertyModification[] ProcessAutoKey(UndoPropertyModification[] modifications)
 {
     this.BeginKeyModification();
     AnimationWindowControl.RecordingState recordingState = new AnimationWindowControl.RecordingState(this.state, AnimationWindowControl.RecordingStateMode.AutoKey);
     UndoPropertyModification[]            result         = AnimationRecording.Process(recordingState, modifications);
     this.EndKeyModification();
     return(result);
 }
Beispiel #3
0
        private UndoPropertyModification[] ProcessAutoKey(UndoPropertyModification[] modifications)
        {
            BeginKeyModification();

            RecordingState recordingState = new RecordingState(state, RecordingStateMode.AutoKey);

            UndoPropertyModification[] discardedModifications = AnimationRecording.Process(recordingState, modifications);

            EndKeyModification();

            return(discardedModifications);
        }
Beispiel #4
0
 private UndoPropertyModification[] PostprocessAnimationRecordingModifications(UndoPropertyModification[] modifications)
 {
     UndoPropertyModification[] result;
     if (!AnimationMode.InAnimationMode())
     {
         Undo.postprocessModifications = (Undo.PostprocessModifications)Delegate.Remove(Undo.postprocessModifications, new Undo.PostprocessModifications(this.PostprocessAnimationRecordingModifications));
         result = modifications;
     }
     else
     {
         result = AnimationRecording.Process(this.state, modifications);
     }
     return(result);
 }
 public void AddKey(PropertyModification[] modifications)
 {
     UndoPropertyModification[] array = new UndoPropertyModification[modifications.Length];
     for (int i = 0; i < modifications.Length; i++)
     {
         PropertyModification propertyModification = modifications[i];
         array[i].previousValue = propertyModification;
         array[i].currentValue  = propertyModification;
     }
     this.BeginKeyModification();
     AnimationWindowControl.RecordingState recordingState = new AnimationWindowControl.RecordingState(this.state, AnimationWindowControl.RecordingStateMode.ManualKey);
     AnimationRecording.Process(recordingState, array);
     this.EndKeyModification();
     this.RemoveFromCandidates(modifications);
     this.ResampleAnimation();
     this.state.Repaint();
 }
        private UndoPropertyModification[] RegisterCandidates(UndoPropertyModification[] modifications)
        {
            bool flag = this.m_CandidateClip == null;

            if (flag)
            {
                this.m_CandidateClip        = new AnimationClip();
                this.m_CandidateClip.legacy = this.state.activeAnimationClip.legacy;
                this.m_CandidateClip.name   = "CandidateClip";
                this.StartCandidateRecording();
            }
            AnimationWindowControl.CandidateRecordingState candidateRecordingState = new AnimationWindowControl.CandidateRecordingState(this.state, this.m_CandidateClip);
            UndoPropertyModification[] array = AnimationRecording.Process(candidateRecordingState, modifications);
            if (flag && array.Length == modifications.Length)
            {
                this.ClearCandidates();
            }
            InspectorWindow.RepaintAllInspectors();
            return(array);
        }
Beispiel #7
0
        private UndoPropertyModification[] RegisterCandidates(UndoPropertyModification[] modifications)
        {
            bool hasCandidates = AnimationMode.IsRecordingCandidates();

            if (!hasCandidates)
            {
                StartCandidateRecording();
            }

            CandidateRecordingState recordingState = new CandidateRecordingState(state, m_CandidateClip);

            UndoPropertyModification[] discardedModifications = AnimationRecording.Process(recordingState, modifications);

            // No modifications were added to the candidate clip, stop recording candidates.
            if (!hasCandidates && discardedModifications.Length == modifications.Length)
            {
                StopCandidateRecording();
            }

            // Make sure inspector is repainted after adding new candidates to get appropriate feedback.
            InspectorWindow.RepaintAllInspectors();

            return(discardedModifications);
        }
Beispiel #8
0
        public void AddKey(PropertyModification[] modifications)
        {
            var undoModifications = new UndoPropertyModification[modifications.Length];

            for (int i = 0; i < modifications.Length; ++i)
            {
                var modification = modifications[i];
                undoModifications[i].previousValue = modification;
                undoModifications[i].currentValue  = modification;
            }

            BeginKeyModification();

            var recordingState = new RecordingState(state, RecordingStateMode.ManualKey);

            AnimationRecording.Process(recordingState, undoModifications);

            EndKeyModification();

            RemoveFromCandidates(modifications);

            ResampleAnimation();
            state.Repaint();
        }