public static void GetMenuEntries(IReadOnlyList <TimelineAction> actions, Vector2?mousePos, List <MenuActionItem> menuItems, MenuFilter filter = MenuFilter.Default) { var globalContext = TimelineEditor.CurrentContext(mousePos); foreach (var action in actions) { try { BuildMenu(action, globalContext, menuItems, filter); } catch (Exception e) { Debug.LogException(e); } } }
/// <summary> /// Execute a given timeline action with the selected clips, tracks and markers. /// </summary> /// <typeparam name="T">Action type to execute.</typeparam> /// <returns>True if the action has been executed, false otherwise.</returns> public static bool InvokeWithSelected <T>() where T : TimelineAction { return(Invoke <T>(TimelineEditor.CurrentContext())); }
public static bool HandleShortcut(Event evt) { if (EditorGUI.IsEditingTextField()) { return(false); } return(HandleShortcut(evt, TimelineActionsWithShortcuts, (x) => ExecuteTimelineAction(x, TimelineEditor.CurrentContext())) || HandleShortcut(evt, ClipActionsWithShortcuts, (x => ExecuteClipAction(x, SelectionManager.SelectedClips()))) || HandleShortcut(evt, TrackActionsWithShortcuts, (x => ExecuteTrackAction(x, SelectionManager.SelectedTracks()))) || HandleShortcut(evt, MarkerActionsWithShortcuts, (x => ExecuteMarkerAction(x, SelectionManager.SelectedMarkers())))); }