Class TimelineShortcutAttribute
Use this attribute to make an action work with the shortcut system.
Inherited Members
Namespace: UnityEditor.Timeline.Actions
Syntax
public class TimelineShortcutAttribute : ShortcutAttribute, _Attribute
Examples
TimelineShortcutAttribute needs to be added to a static method.
public class ShortcutAction : TimelineAction
{
public override ActionValidity Validate(ActionContext _)
{
return ActionValidity.Valid;
}
public override bool Execute(ActionContext _)
{
Debug.Log("Action executed.");
return true;
}
[TimelineShortcut("Test Action", KeyCode.K, ShortcutModifiers.Shift | ShortcutModifiers.Alt)]
public static void HandleShortCut(ShortcutArguments args)
{
Invoker.InvokeWithSelected<ShortcutAction>();
}
}
Constructors
TimelineShortcutAttribute(String, KeyCode, ShortcutModifiers)
TimelineShortcutAttribute Constructor
Declaration
public TimelineShortcutAttribute(string id, KeyCode defaultKeyCode, ShortcutModifiers defaultShortcutModifiers = ShortcutModifiers.None)
Parameters
Type | Name | Description |
---|---|---|
String | 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. |
KeyCode | defaultKeyCode | Optional key code for default binding. |
ShortcutModifiers | defaultShortcutModifiers | Optional shortcut modifiers for default binding. |