Beispiel #1
0
        UndoPropertyModification[] PostProcessModifications(UndoPropertyModification[] modifications)
        {
            Dictionary <int, FTrackEditor> trackEditors = new Dictionary <int, FTrackEditor>();

            foreach (UndoPropertyModification modification in modifications)
            {
                if (modification.currentValue.target is FEvent)
                {
                    FTrack track = ((FEvent)modification.currentValue.target).GetTrack();
                    if (track != null)
                    {
                        FTrackEditor trackEditor = _sequenceEditor.GetEditor <FTrackEditor>(track);
                        if (!trackEditors.ContainsKey(trackEditor.GetInstanceID()))
                        {
                            trackEditors.Add(trackEditor.GetInstanceID(), trackEditor);
                        }
                    }
                }
                else if (modification.currentValue.target is FTrack)
                {
                    FTrackEditor trackEditor = _sequenceEditor.GetEditor <FTrackEditor>(((FTrack)modification.currentValue.target));
                    if (!trackEditors.ContainsKey(trackEditor.GetInstanceID()))
                    {
                        trackEditors.Add(trackEditor.GetInstanceID(), trackEditor);
                    }
                }
                else if (modification.currentValue.target is FTrackEditor)
                {
                    FTrackEditor trackEditor = (FTrackEditor)modification.currentValue.target;
                    if (!trackEditors.ContainsKey(trackEditor.GetInstanceID()))
                    {
                        trackEditors.Add(trackEditor.GetInstanceID(), trackEditor);
                    }
                }
//				Debug.Log( "path: " + modification.propertyModification.propertyPath + " target: " + modification.propertyModification.target.name + " value: " + modification.propertyModification.value );
            }

            Dictionary <int, FTrackEditor> .Enumerator e = trackEditors.GetEnumerator();

            while (e.MoveNext())
            {
                e.Current.Value.OnTrackChanged();
            }

            return(modifications);
        }
Beispiel #2
0
        protected override void Init(FObject obj)
        {
            _timeline = (FTimeline)obj;

            _trackEditors.Clear();

            List <FTrack> tracks = _timeline.GetTracks();

            for (int i = 0; i < tracks.Count; ++i)
            {
                FTrack       track       = tracks[i];
                FTrackEditor trackEditor = _sequenceEditor.GetEditor <FTrackEditor>(track);
                trackEditor.Init(track, this);
                _trackEditors.Add(trackEditor);
            }
        }