コード例 #1
0
ファイル: MarkerItem.cs プロジェクト: BaseDorp/TankGame
        public ITimelineItem CloneTo(TrackAsset parent, double time)
        {
            var item = new MarkerItem(MarkerModifier.CloneMarkerToParent(m_Marker, parent));

            item.start = time;
            return(item);
        }
コード例 #2
0
        internal static ItemsPerTrack DuplicateItems(ItemsPerTrack items, TrackAsset target, WindowState state, string undoOperation)
        {
            var duplicatedItems = new List <ITimelineItem>();

            PlayableDirector director = null;

            if (state != null)
            {
                director = state.editSequence.director;
            }

            var clips = items.clips.ToList();

            if (clips.Any())
            {
                TimelineUndo.PushUndo(target, undoOperation);
                duplicatedItems.AddRange(DuplicateClips(clips, director, target).ToItems());
                TimelineUndo.PushUndo(target, undoOperation); // second undo causes reference fixups on redo (case 1063868)
            }

            var markers = items.markers.ToList();

            if (markers.Any())
            {
                duplicatedItems.AddRange(MarkerModifier.CloneMarkersToParent(markers, target).ToItems());
            }

            return(new ItemsPerTrack(target, duplicatedItems.ToArray()));
        }
コード例 #3
0
        public static IMarker AddMarkerCommand(TrackAsset target, Type markerType, double time)
        {
            SelectionManager.Clear();
            var marker = MarkerModifier.CreateMarkerAtTime(target, markerType, time);

            TimelineWindow.instance.state.Refresh();
            return(marker);
        }
コード例 #4
0
ファイル: TimelineHelpers.cs プロジェクト: 0geova0/Jam
        internal static ItemsPerTrack DuplicateItems(ItemsPerTrack items, TrackAsset target, IExposedPropertyTable sourceTable, IExposedPropertyTable destTable, string undoOperation)
        {
            var duplicatedItems = new List <ITimelineItem>();
            var clips           = items.clips.ToList();

            if (clips.Any())
            {
                TimelineUndo.PushUndo(target, undoOperation);
                duplicatedItems.AddRange(DuplicateClips(clips, sourceTable, destTable, target).ToItems());
                TimelineUndo.PushUndo(target, undoOperation); // second undo causes reference fixups on redo (case 1063868)
            }

            var markers = items.markers.ToList();

            if (markers.Any())
            {
                duplicatedItems.AddRange(MarkerModifier.CloneMarkersToParent(markers, target).ToItems());
            }

            return(new ItemsPerTrack(target, duplicatedItems.ToArray()));
        }
コード例 #5
0
ファイル: MarkerItem.cs プロジェクト: BaseDorp/TankGame
 public void Delete()
 {
     MarkerModifier.DeleteMarker(m_Marker);
 }