コード例 #1
0
 /// <summary>
 /// Records any changes done on the Timeline Marker after being called.
 /// </summary>
 /// <param name="marker">The timeline clip being modified.</param>
 /// <param name="undoTitle">The title of the action to appear in the undo history (i.e. visible in the undo menu).</param>
 public static void RegisterMarker(IMarker marker, string undoTitle)
 {
     using (var undo = new UndoScope(undoTitle))
     {
         if (marker is Object o)
         {
             undo.AddObject(o);
         }
         else if (marker != null)
         {
             undo.AddObject(marker.parent);
         }
     }
 }
コード例 #2
0
        /// <summary>
        /// Records any changes done on the timeline after being called, including any changes
        ///  to any clips, tracks and markers that occur on the timeline.
        /// </summary>
        /// <param name="asset">The timeline asset being modified.</param>
        /// <param name="undoTitle">The title of the action to appear in the undo history (i.e. visible in the undo menu).</param>
        public static void RegisterCompleteTimeline(TimelineAsset asset, string undoTitle)
        {
            if (asset == null)
            {
                return;
            }

            using (var undo = new UndoScope(undoTitle))
            {
                undo.AddObject(asset);
                undo.Add(asset.flattenedTracks);
                foreach (var t in asset.flattenedTracks)
                {
                    undo.Add(t.GetClips(), true);
                    undo.Add(t.GetMarkers());
                }
            }
        }
コード例 #3
0
 /// <summary>
 /// Records any changes done on the track after being called, including any changes
 ///  to clips on the track, but not on markers or PlayableAssets attached to the clips.
 /// </summary>
 /// <param name="asset">The timeline track being modified.</param>
 /// <param name="undoTitle">The title of the action to appear in the undo history (i.e. visible in the undo menu).</param>
 public static void RegisterTrack(TrackAsset asset, string undoTitle)
 {
     using (var undo = new UndoScope(undoTitle))
         undo.AddObject(asset);
 }
コード例 #4
0
 /// <summary>
 /// Records any changes done on the PlayableAsset after being called.
 /// </summary>
 /// <param name="asset">The timeline track being modified.</param>
 /// <param name="undoTitle">The title of the action to appear in the undo history (i.e. visible in the undo menu).</param>
 public static void RegisterPlayableAsset(PlayableAsset asset, string undoTitle)
 {
     using (var undo = new UndoScope(undoTitle))
         undo.AddObject(asset);
 }