Class TimelineAction
Base class for a timeline action. Inherit from this class to make an action on a timeline after a menu click and/or a key shortcut.
Inherited Members
Namespace: UnityEditor.Timeline.Actions
Assembly: Unity.Timeline.Editor.dll
Syntax
[ActiveInMode(TimelineModes.Default)]
public abstract class TimelineAction
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.
Examples
Simple Timeline Action example (with context menu and shortcut support).
Methods
Execute(ActionContext)
Execute the action.
Declaration
public abstract bool Execute(ActionContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| ActionContext | context | Context for the action. |
Returns
| Type | Description |
|---|---|
| bool | true if the action has been executed. false otherwise |
See Also
Validate(ActionContext)
Defines the validity of an Action based on the context.
Declaration
public abstract ActionValidity Validate(ActionContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| ActionContext | context | Context for the action. |
Returns
| Type | Description |
|---|---|
| ActionValidity | Visual state of the menu for the action. |