Exemple #1
0
 static void AddMarkersCallback(ICollection <TrackAsset> targets, Type markerType, double time, Object obj)
 {
     SelectionManager.Clear();
     foreach (var target in targets)
     {
         var marker = TimelineHelpers.CreateMarkerOnTrack(markerType, obj, target, time);
         SelectionManager.Add(marker);
     }
     TimelineEditor.Refresh(RefreshReason.ContentsAddedOrRemoved);
 }
Exemple #2
0
        static void AddSingleMarkerCallback(Type markerType, double time, TimelineAsset timeline, PlayableDirector director, Object assignableObject)
        {
            timeline.CreateMarkerTrack();
            var markerTrack = timeline.markerTrack;

            SelectionManager.Clear();
            var marker = TimelineHelpers.CreateMarkerOnTrack(markerType, assignableObject, markerTrack, time);

            SelectionManager.Add(marker);

            if (typeof(INotification).IsAssignableFrom(markerType) && director != null)
            {
                if (director != null && director.GetGenericBinding(markerTrack) == null)
                {
                    director.SetGenericBinding(markerTrack, director.gameObject);
                }
            }

            TimelineEditor.Refresh(RefreshReason.ContentsAddedOrRemoved);
        }