Class ClipAction
Base class for a clip action. Inherit from this class to make an action that would react on selected clips after a menu click and/or a key shortcut.
Inherited Members
Namespace: UnityEditor.Timeline.Actions
Assembly: solution.dll
Syntax
[ActiveInMode(TimelineModes.Default)]
public abstract class ClipAction
Remarks
To add an action as a menu item in the Timeline context menu, add MenuEntryAttribute on the action class. To make an action to react to a shortcut, use the Shortcut Manager API with TimelineShortcutAttribute. ShortcutAttribute
Examples
Simple Clip Action example (with context menu and shortcut support).
[MenuEntry("Custom Actions/Sample clip Action")]
public class SampleClipAction : ClipAction
{
public override ActionValidity Validate(IEnumerable<TimelineClip> clip)
{
return ActionValidity.Valid;
}
public override bool Execute(IEnumerable<TimelineClip> items)
{
Debug.Log("Test Action");
return true;
}
[TimelineShortcut("SampleClipAction", KeyCode.K)]
public static void HandleShortCut(ShortcutArguments args)
{
Invoker.InvokeWithSelectedClips<SampleClipAction>();
}
}
Methods
Name | Description |
---|---|
Execute(IEnumerable<TimelineClip>) | Execute the action based on clips. |
Validate(IEnumerable<TimelineClip>) | Defines the validity of an Action for a given set of clips. |