No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ManipulationsClips.cs 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using UnityEditor.Timeline.Actions;
  2. using UnityEngine;
  3. namespace UnityEditor.Timeline
  4. {
  5. class DrillIntoClip : Manipulator
  6. {
  7. protected override bool DoubleClick(Event evt, WindowState state)
  8. {
  9. if (evt.button != 0)
  10. return false;
  11. var guiClip = PickerUtils.TopmostPickedItem() as TimelineClipGUI;
  12. if (guiClip == null)
  13. return false;
  14. if (!TimelineWindow.instance.state.editSequence.isReadOnly && (guiClip.clip.curves != null || guiClip.clip.animationClip != null))
  15. Invoker.Invoke<EditClipInAnimationWindow>(new[] { guiClip.clip });
  16. if (guiClip.supportsSubTimelines)
  17. Invoker.Invoke<EditSubTimeline>(new[] { guiClip.clip });
  18. return true;
  19. }
  20. }
  21. class ContextMenuManipulator : Manipulator
  22. {
  23. protected override bool MouseDown(Event evt, WindowState state)
  24. {
  25. if (evt.button == 1)
  26. ItemSelection.HandleSingleSelection(evt);
  27. return false;
  28. }
  29. protected override bool ContextClick(Event evt, WindowState state)
  30. {
  31. if (evt.alt)
  32. return false;
  33. var selectable = PickerUtils.TopmostPickedItem() as ISelectable;
  34. if (selectable != null && selectable.IsSelected())
  35. {
  36. SequencerContextMenu.ShowItemContextMenu(evt.mousePosition);
  37. return true;
  38. }
  39. return false;
  40. }
  41. }
  42. }