public static void SelectClipsInSpanInTrack(TrackAsset track, double start, double end)
        {
            var selectionManager = TimelineBase.selectionManager;
            var clear            = selectionManager.GetMethod("Clear");
            var add = selectionManager.GetMethod("Add", new Type[] { typeof(TimelineClip) });

            clear.Invoke(null, null);

            foreach (var clip in ClipUtils.GetClipsInSpanInTrack(track, start, end))
            {
                add.Invoke(null, new object[] { clip });
            }

            TimelineWindowUtils.Repaint();
        }
        public static void SelectClipsFromCursor(ClipSelection selection)
        {
            var    director = TimelineEditor.inspectedDirector;
            var    asset    = TimelineEditor.inspectedAsset;
            double time     = TimelineWindowUtils.GetCursor();

            var selectionManager = TimelineBase.selectionManager;
            var clear            = selectionManager.GetMethod("Clear");
            var add = selectionManager.GetMethod("Add", new Type[] { typeof(TimelineClip) });

            clear.Invoke(null, null);

            foreach (var track in asset.GetRootTracks())
            {
                if (selection == ClipSelection.Under)
                {
                    foreach (var clip in ClipUtils.GetClipsAtTimeInTrack(track, time))
                    {
                        add.Invoke(null, new object[] { clip });
                    }
                }
                else if (selection == ClipSelection.Before)
                {
                    foreach (var clip in ClipUtils.GetClipsBeforeTimeInTrack(track, time))
                    {
                        add.Invoke(null, new object[] { clip });
                    }
                }
                else if (selection == ClipSelection.After)
                {
                    foreach (var clip in ClipUtils.GetClipsAfterTimeInTrack(track, time))
                    {
                        add.Invoke(null, new object[] { clip });
                    }
                }
            }

            TimelineWindowUtils.Repaint();
        }
        public static TrackAsset GetTrack(System.Object obj)
        {
            var clip = ClipUtils.GetClip(obj);

            return(clip.parentTrack);
        }