Exemplo n.º 1
0
 public override void Init(IControl parent)
 {
     parent.DoubleClick += delegate(object target, Event evt, TimelineWindow.TimelineState state)
     {
         TimelineClipGUI timelineClipGUI = target as TimelineClipGUI;
         bool            result;
         if (timelineClipGUI == null || timelineClipGUI.clip == null)
         {
             result = base.IgnoreEvent();
         }
         else if (evt.get_button() != 0)
         {
             result = base.IgnoreEvent();
         }
         else if (!timelineClipGUI.rect.Contains(evt.get_mousePosition()))
         {
             result = base.IgnoreEvent();
         }
         else if (timelineClipGUI.clip.curves != null || timelineClipGUI.clip.animationClip != null)
         {
             ItemActionInvoker.InvokeByName <TimelineClip>("EditClipInAnimationWindow", state, timelineClipGUI.clip);
             result = base.ConsumeEvent();
         }
         else
         {
             result = base.IgnoreEvent();
         }
         return(result);
     };
 }
Exemplo n.º 2
0
        public override bool Execute(TimelineWindow.TimelineState state)
        {
            bool result;

            if (SelectionManager.GetCurrentInlineEditorCurve() != null)
            {
                result = false;
            }
            else
            {
                ITimelineItem[] array = (from x in SelectionManager.SelectedItemGUI()
                                         select x.selectableObject as ITimelineItem).ToArray <ITimelineItem>();
                if (array.Length > 0)
                {
                    ItemActionInvoker.InvokeByName <TimelineClip>("DeleteClips", state, array);
                    ItemActionInvoker.InvokeByName <TimelineMarker>("DeleteMarkers", state, array);
                }
                TrackAsset[] array2 = SelectionManager.SelectedTracks().ToArray <TrackAsset>();
                if (array2.Length > 0)
                {
                    TrackAction.InvokeByName("DeleteTracks", state, array2);
                }
                result = (array.Length > 0 || array2.Length > 0);
            }
            return(result);
        }
Exemplo n.º 3
0
 public static bool InvokeByName <T>(string actionName, TimelineWindow.TimelineState state, T item) where T : class, ITimelineItem
 {
     ITimelineItem[] items = new ITimelineItem[]
     {
         item
     };
     return(ItemActionInvoker.InvokeByName <T>(actionName, state, items));
 }
 public override bool Execute(TimelineWindow.TimelineState state)
 {
     ITimelineItem[] array = (from x in SelectionManager.SelectedItemGUI()
                              select x.selectableObject as ITimelineItem).ToArray <ITimelineItem>();
     if (array.Length > 0)
     {
         ItemActionInvoker.InvokeByName <TimelineClip>("DuplicateClips", state, array);
         ItemActionInvoker.InvokeByName <TimelineMarker>("DuplicateMarkers", state, array);
     }
     TrackAsset[] array2 = SelectionManager.SelectedTracks().ToArray <TrackAsset>();
     if (array2.Length > 0)
     {
         TrackAction.InvokeByName("DuplicateTracks", state, array2);
     }
     return(true);
 }
Exemplo n.º 5
0
 public static bool InvokeByName <T>(string actionName, TimelineWindow.TimelineState state, T[] items) where T : class, ITimelineItem
 {
     ITimelineItem[] items2 = items.Cast <ITimelineItem>().ToArray <ITimelineItem>();
     return(ItemActionInvoker.InvokeByName <T>(actionName, state, items2));
 }