TimelineShortcutAttribute.cs 1.3 KB

123456789101112131415161718192021222324
  1. using UnityEditor.ShortcutManagement;
  2. using UnityEngine;
  3. namespace UnityEditor.Timeline.Actions
  4. {
  5. /// <summary>
  6. /// Use this attribute to make an action work with the shortcut system.
  7. /// </summary>
  8. /// <example>
  9. /// TimelineShortcutAttribute needs to be added to a static method.
  10. /// <code source="../../DocCodeExamples/TimelineAttributesExamples.cs" region="declare-timelineShortcutAttr" title="TimelineShortcutAttr"/>
  11. /// </example>
  12. public class TimelineShortcutAttribute : ShortcutManagement.ShortcutAttribute
  13. {
  14. /// <summary>
  15. /// TimelineShortcutAttribute Constructor
  16. /// </summary>
  17. /// <param name="id">Id to register the shortcut. It will automatically be prefix by 'Timeline/' in order to be in the 'Timeline' section of the shortcut manager.</param>
  18. /// <param name="defaultKeyCode">Optional key code for default binding.</param>
  19. /// <param name="defaultShortcutModifiers">Optional shortcut modifiers for default binding.</param>
  20. public TimelineShortcutAttribute(string id, KeyCode defaultKeyCode, ShortcutModifiers defaultShortcutModifiers = ShortcutModifiers.None)
  21. : base("Timeline/" + id, typeof(TimelineWindow), defaultKeyCode, defaultShortcutModifiers) {}
  22. }
  23. }